单项选择题
Which statement is true?()
A. An anonymous inner class may be declared as final.
B. An anonymous inner class can be declared as private.
C. An anonymous inner class can implement multiple interfaces.
D. An anonymous inner class can access final variables in any enclosing scope.
E. Construction of an instance of a static inner class requires an instance of the enclosing outer class.
点击查看答案
相关考题
- 多项选择题 Whichtwodemonstratean“isa”relationship?()
- 多项选择题 public class MethodOver { public void setVar (int a, int b, float c) { } } Which two overload the setVar method?()
- 多项选择题 public class ConstOver { public ConstOver (int x, int y, int z) { } } Which two overload the ConstOver constructor? ()
- 单项选择题 public class test { public static void add3 (Integer i){ int val = i.intValue ( ); val += 3; i = new Integer (val); } public static void main (String args [ ] ) { Integer i = new Integer (0); add3 (i); system.out.printIn (i.intValue ( ) ); } } What is the result?()
- 填空题 Public class test ( Public static void stringReplace (String text) ( Text = text.replace („j„ , „i„); ) public static void bufferReplace (StringBuffer text) ( text = text.append (“C”) ) public static void main (String args ){ String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”); stringReplace (textString); BufferReplace (textBuffer); System.out.printIn (textString + textBuffer); } ) What is the output?()
- 填空题 Public class test ( Public static void main (String args) ( System.out.printIn (6^3); ) ) What is the output? ()
- 单项选择题 public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i) { boolean b: b = i < 10 | methodB (4); b = i < 10 || methodB (8); ) public static void main (String args) } ( methodA (0); system.out.printIn(j); ) ) What is the result?()
- 单项选择题 Integer i = new Integer (42); Long 1 = new Long (42); Double d = new Double (42.0); Which two expressions evaluate to True? ()
- 单项选择题 public class test ( public static void main (String args) { int i = 0xFFFFFFF1; int j = ~i; } ) What is the decimal value of j at line 5?()
- 单项选择题 Consider the following class: class Test(int i) { void test(int i) { System.out.println(“I am an int.”); } void test(String s) { System.out.println(“I am a string.”); } public static void main(String args) { Test t=new Test(); char ch=“y”; t.test(ch); } } Which of the statements below is true?()
- 单项选择题 Howcanyouforcegarbagecollectionofanobject?()
- 多项选择题 Choosethethreevalididentifiersfromthoselistedbelow.()