Answer to Question 19)
Objective 4.6)
2) An event listener may be removed from a component
3) The ActionListener interface has no corresponding Adapter class
A component may have multiple event listeners attached. Thus a field may need to respond to both the mouse and the keyboard, requiring multiple event handlers. The ActionListener has not matching Adapter class because it has only one method, the idea of the Adapter classes is to eliminate the need to create blank methods.
For more information on this topic go to
http://www.jchq.net/tutorial/04_06Tut.htm
--------------------------------------------------------------------------------
Answer to Question 20)
Objective 4.3)
3) transient
4) volatile
Option 1, sizeof is designed to catch out the C/C++ programmers. Java does not have a sizeof keyword as the size of primitives should be consistent on all Java implementations. Although a program needs a main method with the standard signature to start up it is not a keyword. The real keywords are less common not a keyword. The real keywords are less commonly used and therefore might not be so familiar to you.
For more information on this topic go to
http://www.jchq.net/tutorial/04_03Tut.htm
--------------------------------------------------------------------------------
Answer to Question 21)
Objective 1.3)
3) The default constructor takes no parameters
4) The default constructor is not created if the class has any constructors of its own.
Option 1 is fairly obviously wrong as constructors never have a return type. Option 2 is very dubi if the class has any constructors of its own.
Option 1 is fairly obviously wrong as constructors never have a return type. Option 2 is very dubious as well as Java does not offer void as a type for a method or constructor.
For more information on this topic go to
http://www.jchq.net/tutorial/05_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 22)
Objective 4.1)
1) All of the variables in an interface are implicitly static
2) All of the variables in an interface are implicitly final
3) All of the methods in an interface are implictly abstract
All the variables in an interface are implicitly static and final. Any methods in an interface have no body, so may not access any type of variable
http://www.jchq.net/tutorial/04_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 23)
Objective 4.5)
2) The + operator is overloaded for concatenation for the String class
In Java Strings are implemented as a class within the Java.lang package with the special distinction that the + operator is overloaded. If you thought that the String class is implemented as a char array, you may have a head full of C/++ that needs emptying. There is not "wrapper class" for String as wrappers are only for primitive types.
If you are surprised that option 4 is not a correct answer it is because length is a method for the String class, but a property for and array and it is easy to get the two confused.
http://www.jchq.net/tutorial/05_01Tut.htm
【责编:yunyun 纠错】
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] 