错误:此类应提供默认构造函数(…)

我得到以下错误:

错误:此类应提供默认构造函数(不带参数的公共构造函数)(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添加一个默认构造TwitterAPI

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

你需要一个无参数的构造函数:

 public TwitterAPI(){ } 

错误说明了一切,你应该提供一个默认的构造函数。
将此添加到您的class级:

 public TwitterAPI() { }