Java? - Reclaiming The Unused Memory by The Invalid Objects. Garbage Collector Is
Java? - Reclaiming The Unused Memory by The Invalid Objects. Garbage Collector Is
Can you instantiate the Math class? - You cant instantiate the math class. All the
methods in this class are static. And the constructor is not public.
What is singleton? - It is one of the design pattern. This falls in the creational pattern of
the design pattern. There will be only one instance for that entire JVM. You can achieve this
by having the private constructor in the class. For eg., public class Singleton { private static
final Singleton s = new Singleton(); private Singleton() { } public static Singleton
getInstance() { return s; } // all non static methods }
What is DriverManager? - The basic service to manage set of JDBC drivers.
What is Class.forName() does and how it is useful? - It loads the class into the
ClassLoader. It returns the Class. Using that you can get the instance ( classinstance.newInstance() ).
Inq adds a question: Expain the reason for each keyword of
public static void main(String args[])