Sunday, 14 June 2009

Java Certification Question 0004

Which of the following statements are true?
1) The garbage collection algorithm in Java is vendor implemented
2) The size of primitives is platform dependent
3) The default type for a numerical literal with decimal component is a float.
4) You can modify the value in an Instance of the Integer class with the setValue method



Answer:
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.

No comments: