Logo F2FInterview

Java Basics Interview Questions

Q   |   QA

Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.

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.

Yes, the main() method can be declared final, in addition to being public static.

Map is an Interface and Hashmap is the class that implements Map.

The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow).

HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: