Can main method be declared final?
Yes, the main method can be declared final, in addition to being public static. Read more »
Yes, the main method can be declared final, in addition to being public static. Read more »
No the source file name, if it contains a public class, must be the same as the public class name itself with a .java extension. Read more »
The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them... Read more »
The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point... Read more »
The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else... Read more »
Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0, a boolean will be initialized to false. Read more »
No, they are not keywords in Java. delete is not a keyword in Java. Java does not make use of explicit destructors the way C++ does. To exit a program explicitly... Read more »
No String is not a primitive data type in Java, even though it is one of the most extensively used object. Strings in Java are instances of String class defined... Read more »
Yes, a .java file contain more than one java classes, provided at the most one of them is a public class. Read more »
Yes, an empty .java file is a perfectly valid source file. Read more »
Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a... Read more »
Only public and abstract modifiers are allowed for methods in interfaces. Read more »
Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput... Read more »
All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface. Read more »
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the... Read more »