
1. What if the main method is declared as private?
Answer: 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?
Answer: 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?
Answer: hashCode()
4. Why oracle Type 4 driver is named as oracle thin driver?
Answer: Oracle provides a Type 4 JDBC driver, referred to as the Oracle “thin” driver. This driver includes its own implementation of a TCP/IP version of Oracle’s Net8 written entirely in Java, so it is platform independent, can be downloaded to a browser at runtime, and does not require any Oracle software on the client side. This driver requires a TCP/IP listener on the server side, and the client connection string uses the TCP/IP port address, not the TNSNAMES entry for the database name.
5. What is the Java API?
Answer: The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.
6. What is the GregorianCalendar class?
Answer: The GregorianCalendar provides support for traditional Western calendars.
7. What is the ResourceBundle class?
Answer: The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program’s appearance to the particular locale in which it is being run.
8. Why there are no global variables in Java?
Answer: Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:
The global variables breaks the referential transparency
Global variables create collisions in namespace.
9. What is the SimpleTimeZone class?
Answer: The SimpleTimeZone class provides support for a Gregorian calendar.
10. What is explicit casting?
Answer: Explicit casting in the process in which the complier are specifically informed to about transforming the object.
Source : javacodegeeks.com
No comments:
Post a Comment