JAVAOOP 复习题笔试JAVAOOP 复习题类型:(笔试)范围:内测/月考日期:时长:1 小时总分数:100 分姓名:准考证号:证件号码:理论部分注意:考试结束试卷必须交回,答案填写在答题卡上1
给定两个 java 程序,如下:Text
java 的编译运行成果是(选一项)pubilc interface Face{ int count = 40;}pubilc class Text implements Face{ private static int counter; pubilc static void main(String[]args){ System
println( counter );}}A、40B、41C、0D、12
Java 程序中读入顾客输入的一种值,规定创立一种自定义的异常,假如输入值不小于 10,使用 throw 语句显式地引起异常,异常输出信息为“something’s wrong
”,语句为(选一项)A、if (I>10) throw Exception("something’s wrong
");B、if (I>10) throw Exception e ("something’s wrong
");C、if (I>10) throw new Exception("something’s wrong
");D、if (I>10) throw new Exception e ("something’s wrong
Java 程序中类的定义如下:class Demo { private int[] count; public Demo(){ count=new int[10]; } public void setCount(int ct,int n){ count[n]=ct; } public int getCount(