當我嘗試將strServerIP添加到類服務器,我得到一個:
無法解析符號串
編譯器錯誤。Android的編譯器:無法解析符號串
爲什麼?
package com.example;
public class Server
{
//public static java.lang.string SERVERIP;
public static android.R.string SERVERIP;
public static java.lang.string strServerIP = "monster.idsoftware.com";
public static string strServerIP = "monster.idsoftware.com";
public static int SERVERPORT = 27950;
public static int PROTOCOL = 68;
}
爲什麼strServerIP被定義兩次? – 2010-01-19 12:39:51
在strServerIp上丟失了匈牙利前綴。對於java來說,類型總是在變量旁邊,所以它的冗餘包含在變量名中,而重複是軟件中的一個罪過。 – 2010-01-19 12:50:51