当前分类: Java认证考试综合练习
问题:单选题现有如下五个声明: Linel: int a_really_really_really_long_variable_name=5 ; Line2: int _hi=6; Line3: int big=Integer. getlnteger("7”); Line4:int $dollars=8; line5: int %opercent=9; 哪行无法通过编译?()A Line1B Line3C Line4D Line5...
查看答案
问题:单选题现有: class Cat { Cat (int c) {System.out.print {"cat"+c+" "); } } class SubCat extends Cat { SubCat (int c){super (5); System.out.print ("cable");} SubCat() { this (4); } public static void main (String [] arg...
问题:单选题现有: class TestFoo f int x; String y; int getX() { return x; } String getY() {return y; } void setX (int x) { int Z=7: this.x=x; } 可以添加多少个修饰符来封装此类?()A 5B 4C 3D 2...
问题:单选题public void testIfA(){ if(testIfB("True")){ System.out.println("True"); }else{ System.out.println("Nottrue"); } } public Boolean testIfB(Stringstr){ return Boolean.valueOf(str); } What is the result when method testIfA is invoked?()A TrueB NottrueC Ane...
问题:class Bird { static void talk() { System.out.print("chirp "...
问题:单选题class Test4 { public static void main(String [] args) { boolean x = true; boolean y = false; short z = 42; if((z++ = = 42) (y = true)) z++; if((x = false) || (++z = = 45)) z++; System.out.println("z = " + z); } } 结果为:()A z = 42B z ...
问题:单选题class Animal{ Animal getOne(){return new Animal();}} class Dog extends Animal{ //insert code here } class AnimalTest{ public static void main(String[] args){ Animal[] animal={ new Animal(), new Dog()}; for(Animal a:animal){ Animal x= a....
问题:单选题class Order3 implements Runnable { public static void main(String [] args) { new Thread(new Order3()).start(); for(int x = 0; x 〈 10; x++) System.out.print("m"); } public void run() { for(int x = 0; x 〈 10; x++) { //insert code here System.out.p...
问题:下面说法正确的是()...
问题:单选题事件处理类的真正实现代码一般在哪个类中?()A 框架类中,因为在框架类包括了事件处理所需的大部组件B 入口类中,因为入口类是程序的主体C 事件处理中,因为事件发生时会自动调用事件处理类的函数D 组件类中,因为事件是由组件发生的...
问题:单选题以下哪个组件不支持动作监听器?()A 文本框B 下拉框C 按钮D 列表框...
问题:单选题当动作监听器激发时,会调用什么函数?()A onActivated函数;B actionPerformed函数;C doAction函数;D checkActionOn函数;...
问题:判断题Swing界面一般都会有一个顶级Swing容器,但特殊情况下也可以没有。A 对B 错...
问题:下面哪些代码中声明的变量可以存放10个String对象()...
问题:单选题class TestApp{ public static void main (String[ ] args){ for(int i=0;i10;i++){ if(i==3) break; System.out.print (i); } } } 程序运行后的输出是哪项?()A 0123B 012C 0123456789D 012456789...
问题:以下关于File对象的描述中,错误的是()...
问题:单选题public class TestApp{ public static void main(String[] args){ try{ int i = 0; int j = 1 / i; String myname=null; if(myname.length()2) System.out.print(“1”); }catch(NullPointerException e){ System.out.print(“2”); } catch(Exception e)...
问题:public class Pet{ private String name; public Pet(){ S...
问题:以下算术运算符中错误的是() ...
问题:现有: class Test2 f public static void main (String [] ar...