欢迎来到计算机考试题库网 计算机题库官网
logo
全部科目 > 计算机考试试题及答案解析

未知题型

Giventhefollowingcode:publicclassPerson{intarr[]=newint[10];publicstaticvoidmain(Stringa[]){System.out.println(arr[1]);}}Whichstatementiscorrect?()

    A.Whencompilationsomeerrorwilloccur.
    B.Itiscorrectwhencompilationbutwillcauseerrorwhenrunning.
    C.Theoutputiszero.
    D.Theoutputisnull.
【参考答案】

A
实例变量在类的一个实例构造时完成初始化,而且在类的静态方法中不能直接访问类的非静态成员而只能访问类成员(像上......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)

点击查看答案

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题