Answer to Question 4)
Objective 7.1)
1) The garbage collection algorithm in Java is vendor implemented
Threading and garbage collection are two of the few areas that are platform dependent. This is one of the
reasons why Java is not suitable for realtime programming. It is not a good idea use it to control your
plane or nuclear power station. Once an instance of the Integer class has a value it cannot be changed.
http://www.jchq.net/tutorial/07_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 5)
Objective 10.1)
(Not on the official sub objectives but this topic does come up on the exam)
2) The RandomAccessFile class allows you to move directly to any point a file.
4) The characteristics of an instance of the File class such as the directory separator, depend on the current underlying operating system
The File class can be considered to represent information about a file rather than a real file object. You can create a file in the underlying operating system by passing an instance of a file to a stream such as FileOutputStream. The file will be created when you call the close method of the stream.
http://www.jchq.net/tutorial/10_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 6)
Objective 5.1)
2) The instanceof operator can be used to determine if a reference is an instance of a particular primitive wrapper class
The instanceof operator can only be used to make a static comparison with a class type. Java1.1 added the isInstance method to the class Class to allow you to dynamically determine a class type. The exam does not test you on isInstance.
http://www.jchq.net/tutorial/05_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 7)
Objective 4.1)
2) Interfaces cannot have constructors
If you try to create a constructor for an Interface the compiler will give you an error message something like
"interface can't have constructors".
4) Interfaces are the Java approach to addressing the single inheritance model, but require implementing classes to create the functionality of the Interfaces.
An interface may contain variables as well as methods. However any variables are final by default and must be assigned values on creation. A class can only extend one other class (single inheritance) but may implement as many interfaces as you like (or is sensible).
http://www.jchq.net/tutorial/04_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 8)
Objective 9.1)
None of these are valid statements. The Math class is final and cannot be extended. The max method takes two parameters, round only takes one parameter and there is no mod parameter. You may get questions in the exam that have no apparently correct answer. If you are absolutely sure this is the case, do not check any of the options.
http://www.jchq.net/tutorial/09_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 9)
Objective 7.1)
1) The Runnable interface has only one method run that needs to be created in any class that implements it. The start method is used to actually call and start the run method executing.
http://www.jchq.net/tutorial/07_01Tut.htm
--------------------------------------------------------------------------------
Answer to Question 10)
Objective 4.5)
1) A byte can represent between -128 to 127
The char type is the only unsigned type in Java and thus cannot represent a negative number.
For more information on this topic go to
http://www.jchq.net/tutorial/04_05Tut.htm
--------------------------------------------------------------------------------
Answer to Question 11)
Objective 1.2)
2) Compilation and no output at runtime
Because the method in Base called Base has a return type it is not a constructor and there for does not get called on creation of an instance of its child class In
For more information on this topic go to
http://www.jchq.net/tutorial/01_02Tut.htm