未分类题
Giventhefollowingcode:publicclassPerson{intarr[]=newint[10];publicstaticvoidmain(Stringa[]){System.out.println(arr[1]);}}Whichstatementiscorrect?()
A.Whencompilationsomeerrorwilloccur.
B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunning.
C.Theoutputiszero.
D.Theoutputisnull.
【参考答案】
A
实例变量在类的一个实例构造时完成初始化,而且在类的静态方法中不能直接访问类的非静态成员而只能访问类成员(像上......
(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)