"We work to recruit. We help you retain."

Prepare for Java/J2EE Interview. Java/J2EE interview Q&A

Note: Each question/Ans posted will be verified by our technical team before posting.

Java - J2EE Q&A

Q1.what is a Transient variable?
Ans. Transient variable is a variable that cannot be serialized.

Q2.which containers use a border Layout as their default layout?
Ans. The window, Frame and Dialog classes use a border layout as their default layout.

Q3.What is synchronization and why is it important?
Ans. With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to errors.

Q4. Can a lock be acquired on a class?
Ans. Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

Q5. Is null a keyword?
Ans. The null value is NOT a keyword.

Q6. What state does a thread enter when it terminates its processing?
Ans. When a thread terminates its processing, it enters the DEAD state.

Q7. What is a Vector class?
Ans. The Vector class provides the capability to implement a growable array of objects

Q8. What is the difference between yielding and sleeping?
Ans. When a task invokes its yield() method, it returns to the ready state.
When a task invokes its sleep() method, it returns to the waiting state.

Q9. Is sizeof a keyword?
Ans. The sizeof operator is NOT a keyword.

Q10. What are wrapped classes?
Ans. Wrapped classes are classes that allow primitive types to be accessed as objects.

Q11. Does garbage collection guarantee that a program will not run out of memory?
Ans. Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection

Q12. Which statement appears as the first line in a java file (excluding blank lines and comments).
Ans. A package statement

Click here for More...


Get -> HOT JOBS.

For more information on our solutions please write to contact@itjobzone.biz