【发布时间】:2013-01-26 09:32:54
【问题描述】:
我真的不确定它为什么会这样做,但这似乎是括号的问题。 在 Eclipse 中运行这段 Android 代码时出现以下错误:
private static final String TWITTER_ACCESS_TOKEN_URL = "http://api.twitter.com/oauth/access_token";
private static final String TWITTER_AUTHORZE_URL = "https://api.twitter.com/oauth/authorize";
private static final String TWITTER_REQUEST_URL = "https://api.twitter.com/oauth/request_token";
public static final String itemOfClothing;
public static final String clothingEmotion;
public static final String user;<<<<<<<<<<<<<<<<<<<<< Syntax error on token ";", { expected after this token
itemOfClothing = "pants";
clothingEmotion = "I'm feeling left in the dark";
user = "stuart";
public static String MESSAGE = itemOfClothing +": " + clothingEmotion + "! #" + user + "EmotionalClothing"; <<<<<<<<<<<<<<<<<<<<<< Syntax error, insert "}" to complete Block
public TwitterApp(Activity context, String consumerKey, String secretKey) {
this.context = context;
【问题讨论】:
-
感谢您的评论。我刚刚尝试过,但是当我这样做时,我得到了同样的错误。
-
@Luksprog.. 他们不是已经声明为字符串了吗?
-
@RohitJain 是的,我需要眼镜。
-
@mattlongman Android 标签不是必需的。这是语法问题。
标签: java eclipse syntax static-members brackets