Package cn. Zshen. Obj.
Public class TestConstructor1 {
Public static void main (String [] args) {
The User zshen=new User (" shenzhong, "" qwerty890");
System. The out. Println (zshen. Name + "" + zshen. PWD).
The User yzhang=new User (" zhangyue ", "asdfgh890", 0818); 0818//there's a problem, why not!!!!!!!!!!!!!!!!!!!!
System. The out. Println (yzhang. Id);
}
}
The class User {
String name;
String PWD;
Int id;
Public User () {
}
Public User (String name, String PWD) {
this.name=name;
Enclosing the PWD=PWD;
}
Public User (String name, String PWD, int id) {
this.name=name;
Enclosing the PWD=PWD;
this.id=id;
}
}
CodePudding user response:
Int cannot begin with 0, change the String typeCodePudding user response:
Oh oh thank you.CodePudding user response:
Int starting with 0 represents 8 hexadecimal, while the octal number 0818, appeared more than 7 figures did not carry, so literal errorCodePudding user response:
Regardless of the code, count your life began from 01, or starting from 1? I mean, normal circumstances