Answer to Question 32)
Objective 1.2)
3) Only one instance of a static variable will exist for any amount of class instances
Option 1) is more a description of a final variable. Option 2 is designed to fool Visual Basic programmers like me as this is how you can use the keyword static in VB. The modifier static can be applied to a class, method or variable.
http://www.jchq.net/tutorial/01_02Tut.htm
--------------------------------------------------------------------------------
Answer to Question 33)
Objective 11.1)
1) Java uses a system called UTF for I/O to support international character sets
3) An instance of FileInputStream may not be chained to an instance of FileOutputStream
4) File I/O activities requires use of Exception handling
Internally Java uses Unicode which are 16 bit characters. For I/O Java uses UTF which may be more thatn 16 bits per chamore thatn 16 bits per character.
Generally InputStreams can only be chained to other InputStreams and OutputStreams can only be chained to other OutputStreams. The piped streams are an exception to this.
http://www.jchq.net/tutorial/11_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 34)
Objective 1.2)
1) Compile time error
It wil produce an error like "Abstract and native method can't have a body. This is typical of the more misleading question where you might think it is asking you about the circumstances under which the finally clause runs, but actually it is about something else.
http://www.jchq.net/tutorial/07_02Tut.htm
--------------------------------------------------------------------------------
Answer to Question 35)
Objective 7.1)
2) Compilation and run with the output "Running"
This is perfectly legitimate if useless sample of creating an instnace of a Thread and causing its run method to execute via a call to the start method. The Thread class is part of the core java.lang package and does not need any explicit import statement. The reference to a Thread target is an attempt to mislead with a reference to the method of using the Runnable interface instead of simply inheriting from the Thread super class.
http://www.jchq.net/tutorial/07_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 36)
Objective 11.1)
1) RandomAccessFile raf=new RandomAccessFile("myfile.txt","rw");
The RandomAccessFile is an anomaly in the Java I/O architecture. It descends directly from Object and is not part of the Streams architecture.
http://www.jchq.net/tutorial/11_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 37)
Objective 6.2)
2) public int amethod(int i, int j) {return 99;}
3) protected void amethod (long l){}
4) private void anothermethod(){}
Option 1 will not compile on two counts. One is the obvious one that it claims to return an integer. The other is that it is effectivly an attempt to redefine a method within the same class. The change of name of the parameter from i to z has no effect and a method cannot be overriden within the same class.
http://www.jchq.net/tutorial/06_02Tut.htm
--------------------------------------------------------------------------------
Answer to Question 38)
Objective 8.1)
1) Code must be written to cause a frame to close on selecting the system close menu
2) The default layout for a Frame is the BorderLayout Manager
4) ThrLayout Manager
4) The GridBagLayout manager makes extensive use of the the GridBagConstraints class.
You can change the layout manager for a Frame or any other container whenever you like.
http://www.jchq.net/tutorial/08_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 39)
Objective 1.2)
4) The code will compile without error
There are no restrictions on the level of nesting for inner/nested classes. Inner classes may be marked private. The main method is not declared as public static void main, and assuming that the commandline was java Droitwich it would not be invoked anyway.
http://www.jchq.net/tutorial/01_02Tut.htm
【责编:yunyun 纠错】
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] 