+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Java Interview Questions and Answers


1
What if the main method is declared as private?

The program compiles properly but at runtime it will give “Main method not public.” message.

2
What is meant by pass by reference and pass by value in Java?

Pass by reference means, passing the address itself rather than passing the value. Pass by value means passing a copy of the value.

3
If you’re overriding the method equals() of an object, which other method you might also consider?

hashCode()

4
What is the Java API?

The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.

5
What is the GregorianCalendar class?

The GregorianCalendar provides support for traditional Western calendars.

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US