Question 1: Give the use and an example of the scenario where you would use serialVersionUID in a your Java class?
Question 2: Design a Employee class with name, empId, age and address fields.
Any two Employee objects are compared based on their age.
The empId is the unique id for Employee class. The Employee class can be used in Collections and HashMap.
Question 3: Explain what goes in a HashMap or Hashtable, when you store the objects with same hashcode values. Explain your answer in very depth.
Question 4: In JVM Memory, where the private, public, protected, static, String literal and object references are stored?
Question 5: How will you store your exception stack trace in a file? (you should not redirect the console output)
Question 6: What is the use of Weak, Soft, Phantom references in Garbage Collection of java? Give scenarios.
Question 7: How will you keep an object alive for ever in the JVM memory? (trick: use finalize() method)
Question8: What is the difference between JiBX and JAXB?
Answer:
JiBX can provide significant performance improvements over JAXB as it does not use reflection, but instead does byte code generation to optimize databinding.
No comments:
Post a Comment