Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?() A、Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.B、Member variables of the outer instance can never be referred to using only the variable name within the inner instance.C、More than one inner instance can be associated with the same outer instance.D、All variables from the outer instance that should be accessible in the inner instance must be declared final.E、A class that is declared final cannot have any inner classes.
Which statements concerning the correlation between the inner and outer instances of non-static inner classes are true?()
- A、Member variables of the outer instance are always accessible to inner instances, regardless of their accessibility modifiers.
- B、Member variables of the outer instance can never be referred to using only the variable name within the inner instance.
- C、More than one inner instance can be associated with the same outer instance.
- D、All variables from the outer instance that should be accessible in the inner instance must be declared final.
- E、A class that is declared final cannot have any inner classes.
相关考题:
For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()A、jsp:declarationint count = 0;jsp:declarationB、%! int count = 0; %C、jsp:declaration.instanceint count = 0;. jsp:declaration.instanceD、jsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration
What will be the result of attempting to run the following program?() public class Qaa75 { public static void main(String args[]) { String[][][] arr = { { {}, null }, { { "1", "2" }, { "1", null, "3" } }, {}, { { "1", null } } }; System.out.println(arr.length + arr[1][2].length); } } A、The program will terminate with an ArrayIndexOutOfBoundsException.B、The program will terminate with a NullPointerException.C、4 will be written to standard output.D、6 will be written to standard output.E、7 will be written to standard output.
Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()A、%@ import file=’/common/menu.html’ %B、%@ page import=’/common/menu.html’ %C、%@ import page=’/common/menu.html’ %D、%@ include file=’/common/menu.html’ %E、%@ page include=’/common/menu.html’ %
1. public class GoTest { 2. public static void main(String[] args) { 3. Sente a = new Sente(); a.go(); 4. Goban b = new Goban(); b.go(); 5. Stone c = new Stone(); c.go(); 6. } 7. } 8. 9. class Sente implements Go { 10. public void go() { System.out.println(”go in Sente.”); } 11. } 12. 13. class Goban extends Sente { 14. public void go() { System.out.println(”go in Goban”); } 15. } 16. 17. class Stone extends Goban implements Go { } 18. 19. interface Go { public void go(); } What is the result?() A、 go in Goban go in Sente go in SenteB、 go in Sente go in Sente go in GobanC、 go in Sente go in Goban go in GobanD、 go in Goban go in Goban go in SenteE、 Compilation fails because of an error in line 17.
现有: 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 [] args) { SubCat s = new SubCat(); } } 结果为:() A、cat5B、cableC、cable cat5D、cat5 cable
Which of the following range of short is correct?() A、 -27 -- 27-1B、 0 -- 216-1C、 -215 -- 215-1D、 -231 -- 231-1
什么是强制类型转换?在什么情况下需要用到强制类型转换?