网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
Which the following two statements are true?()
- A、 An inner class may be declared as static.
- B、 An anonymous inner class can be declared as public.
- C、 An anonymous inner class can be declared as private.
- D、 An anonymous inner class can extend an abstract class.
- E、 An anonymous inner class can be declared as protected.
参考答案
更多 “Which the following two statements are true?()A、 An inner class may be declared as static.B、 An anonymous inner class can be declared as public.C、 An anonymous inner class can be declared as private.D、 An anonymous inner class can extend an abstract class.E、 An anonymous inner class can be declared as protected.” 相关考题
考题
Which interface does java.util.Hashable implement?() A、 Java.util.Map.B、 Java.util.List.C、 Java.util.Hashable.D、 Java.util.Collection.
考题
程序: class TestApp{ public static void main(String[] args){ System.out.println(multiply(2,3,4,5)); } public int multiply(int[] nums){ int result = 1; for(int x :nums) result *= x; return result; } } 程序运行后的输出是哪项?() A、 14B、 编译错误C、 120D、 24
考题
public class ClassA{ public int getValue(){ int value=0; boolean setting=true; String title="Hello"; if(value||(setting title=="Hello")){return 1;} if(value==1title.equals("Hello")){return 2;} } } And: ClassA a=new ClassA(); a.getValue(); What is the result?()A、1B、2C、Compilation fails.D、The code runs with no output.E、An exception is thrown at runtime.
考题
1. class A implements Runnable ( 2. int i; 3. public void run ( ) ( 4. try ( 5. thread.sleep(5000); 6. i= 10; 7. ) catch(InterruptedException e) {} 8. ) 9. ) 10. 11. public class Test { 12. public static void main (string args[]) ( 13. try ( 14. A a = new A ( ); 15. Thread t = new Thread (a); 16. t.start( ); 17. 18. int j= a.i; 19. 20. ) catch (Exception e) {} 21. ) 22. } Which statement al line 17 will ensure that j=10 at line 19?() A、 a.wait();B、 t.wait();C、 t.join();D、 t.yield();E、 t.notify();F、 a.notify();G、 t.interrupt();
考题
移位和按位运算符有哪些作用?()A、 左移“〈〈”可将整数乘以2或者2的若干次方B、 按位与“”可设置二进制数的某些位为0C、 按位或“”可将两个二进制数相加D、 按位异或“^”可将二进制数的某些位或者所有位设为相反的值E、 无符号右移“”可将整数除以2或者2的若干次方
考题
为将数组myArray的长度由6改为10,现采取以下编码: int[] myArray = new int[6]; myArray = new int[10]; 代码执行后,以下叙述哪项是正确的?() A、 数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素的值为空。B、 数组myArray的长度已由6改为10,其中前6个元素的值不变,后四个元素需再经过初始化后才能使用。C、 数组myArray的长度已由6改为10,原来6个元素的值全部丢失。D、 数组myArray的长度没有变化。
考题
举例说明this关键字的作用。
热门标签
最新试卷