public class TestApp{ public static void main(String[] args){ try{ String myname = null; if(myname.length()>2) System.out.print(“1”); }catch(NullPointerException e){ System.out.print(“2”); } } } 上述程序运行后的输出是哪项?()
时间:2022-09-03
为了良好地组织包结构,Java系统会自动分析包名,并将包名分解为一级级的子目录名,再进行编译或执行。
下列哪项不是Java语言的关键字?()
能够遍历泛型List〈Integer〉 al中的所有元素的语句是哪项?()
下列有关Swing的叙述,哪项错误()
class Sock { String size; String color; public boolean equals(Object o) { Sock s = (Sock) o; return color.equals(s.color); } // insert code here } 哪两个满足 hashCode 的约定?()
现有: class Thread2 implements Runnable { void run() { System.out.print("go "); } public static void main(String [] args) { Thread2 t2 = new Thread2(); Thread t = new Thread(t2); t.start(); } } 结果为:()
现有如下包结构: com -- x -- Alpha.class -- y -- Beta.class -- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()
public class Test{ public static void main(String[]args){ intx=5; boolean b1=true; boolean b2=false; if((x==4)&&!b2) System.out.print("l"); System.out.print("2"); if((b2=true)&&b1) System.out.print("3"); } } What is the result?()
关于动作对象,以下描述中错误的是 ()
现有 1. class Calc { 2. public static void main(String [] args) { 3. try { 4. int x = Integer.parselnt ("42a") ; 5. //insert code here 6. System.out.print ("oops"); 7. } 8. } 9. } 下面哪两行分别插入到第五行,会导致输 "oops" ? ()
单选框(JRadioButton)在图形界面上显示为若干小圆点,它的作用是在几个选项中选一项,且只能选一项。
使用以下哪个类可在GUI中实现按钮功能?()
包访问级的成员能被哪些对象访问到()
如果不使用布局管理器,会出现哪些问题?()
时间:2022-09-02