1. What class allows you to read objects directly from a stream? - The ObjectInputStream class supports the reading of objects from input streams.
  2. What is the difference between a field variable and a local variable? - A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.
  3. How are this() and super() used with constructors? - this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.
  4. What is the relationship between a methodís throws clause and the exceptions that can be thrown during the methodís execution? - A methodís throws clause must declare any checked exceptions that are not caught within the body of the method.
  5. Why are the methods of the Math class static? - So they can be invoked as if they are a mathematical code library.

See Java Interview Questions and Answers : Part 5 for more Java/J2EE Interview Questions.

Sandeep Joshi
Mathematics, Technology and Programming are my passion. I am a part of Java Ecosystem and through this blog, I contribute to it. I am here to blog about my interests, views and experiences.
I am on Google+ and Facebook.
I feel proud to be listed as a "National Memory Record Holder" in the Limca Book of Records, 2009 and have attempted for an International Memory record in the Guiness Book of Records. I can remember the value of PI upto 10,000 digits after the decimal (3.1415.....). You can contact me on javagenious.com(At)gmal.com ; I would like to hear from you :)