错误:此类应提供默认的构造函数(.....)[Instantiatable] [英] Error : This class should provide a default constructor (.....) [Instantiatable]

查看:109
本文介绍了错误:此类应提供默认的构造函数(.....)[Instantiatable]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下错误:

错误:此类应提供默认的构造函数(不带参数的公共构造函数)(com.mrad4tech.development.sportss.TwitterAPI)

Error: This class should provide a default constructor (a public constructor with no arguments) (com.mrad4tech.development.sportss.TwitterAPI)

[Instantiatable]

package com.mrad4tech.development.sportss;

public class TwitterAPI {

    private String twitterApiKey;
    private String twitterAPISecret;
    final static String TWITTER_TOKEN_URL = "https://api.twitter.com/oauth2/token";
    final static String TWITTER_STREAM_URL = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=";

    public TwitterAPI(String twitterAPIKey, String twitterApiSecret){
        this.twitterApiKey = twitterAPIKey;
        this.twitterAPISecret = twitterApiSecret;
    }

    ...
}        

请帮助我

推荐答案

向类TwitterAPI添加默认构造函数.

Add a default constructor to your class TwitterAPI.

//Default constructor takes no arguments
public TwitterAPI() { 
}

这篇关于错误:此类应提供默认的构造函数(.....)[Instantiatable]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆