这是什么意思?
Illegal static declaration in inner class Mobile.mymobile
modifier 'static' is only allowed in constant variable declarations
Line 75, public static void main(String[] args) {
Run Code Online (Sandbox Code Playgroud)
我的代码:
/**
* to write a simple java class Mobile that models a mobile phone.
*
* @author (jamal)
* @version (14/10/13)
*/
public class Mobile
{
// type of phone
private String phonetype;
// size of screen in inches
private int screensize;
// menory card capacity
private int memorycardcapacity;
// name of present service …Run Code Online (Sandbox Code Playgroud) 我试图让我的代码创建新的构造函数对象,我需要创建一个移动电话对象.我已经尝试命名constuctor字段来创建对象.
更新:我已修改string为String,但是现在当我更新它时,我收到错误:
error: constructor Mobile(java.lang.String,int,int,java.lang.String,int,java.lang.String) is already defined in class Mobile
Run Code Online (Sandbox Code Playgroud)
此错误出现在页面底部:
public Mobile(String MobilephoneType, int Mobilescreensize, int Mobilememorycardcapacity, String newserviceprovider, int Mobilecameraresolution,
String MobileGPS) {
Run Code Online (Sandbox Code Playgroud)
这个错误是什么意思?
到目前为止的代码:
/**
* to write a simple java class Mobile that models a mobile phone.
*
* @author (Lewis Burte-Clarke)
* @version (14/10/13)
*/
public class Mobile
{
// type of phone
private String phonetype;
// size of screen in inches
private int screensize;
// menory card capacity
private …Run Code Online (Sandbox Code Playgroud) java ×2