单选题
Java
题号 #2590844
下列选项成员变量声明正确的是( )。
参考答案
C
答案解析
本题考查对成员变量的声明。成员变量的声明格式为:修饰符type变量名;其中type可以是java语言中的任意数据类型,而修饰符可以是public、protected,private,static,final,transient,volatile等。选项A错误,成员变量不能同时声明成public和protected。选项B是类的声明格式,并不是成员变量的声明。成员变量声明应以“;”结尾,选项D错误。选项c声明了-个私有的double型成员变量,为正确答案。
你可能感兴趣的试题
A.t has been created.
B.t has been created.
t is running.
t is running.
C.t is running.
D.编译出错
A.ArrayIndexOutOfBoundsException
B.NumberFormatException
C.ArithmeticException
D.EOFException
A.a=true b=false
b=true C=true
b=true C=true
B.a=true b=false
b=true e=false
b=true e=false
C.a=true b=true
b=true C=false
b=true C=false
D.a=false b=false
b=true C=false
b=true C=false



