抽象类中的属性初始化方式
一、声明同时直接初始化
int c=5;
二、在构造函数中初始化
Test(){
c=5
}
注:其他方式会导致程序编译错误,如:Syntax error on token "c", VariableDeclaratorId expected after this token
抽象类中的属性初始化方式
一、声明同时直接初始化
int c=5;
二、在构造函数中初始化
Test(){
c=5
}
注:其他方式会导致程序编译错误,如:Syntax error on token "c", VariableDeclaratorId expected after this token