Top 10 Java Interview Questions

Category: ZaranTech Training Posted:Mar 01, 2017 By: admin

1. Explain about the dynamic feature of Java.

Java’s dynamic feature is designed to suit the needs of an evolving environment. An extensive amount of run time information can be carried by Java programs which can be used for the purpose of resolving and verifying the accesses to objects during run time.

2. How can you relate the concept of Java Virtual Machine (JVM) to Java’s platform-independent feature?

The concept of Java Virtual Machine fits into the context of Java’s platform-independent feature when a Java program is compiled. During the compilation, the program will not be compiled into platform specific machine, instead into platform independent byte code. After this process, irrespective of any platform that the particular Java program is being run, the bytecode will be distributed over the web and interrupted by JVM.

3. What is the method used to get the primitive data type of a particular string?

parseInt() is the method used to get the primitive data type of any particular string.

4. What are the classes does java.util.regex consist of?

There are three classes in java.util.regex such as Matcher class, PatternSyntaxException class, and Pattern class.

5. What is the major advantage of a byte data type?

As a byte is four times larger than an int, the byte data type is mainly used is some amount of significant space has to be preserved in a large array, most importantly in place of integers.

6. List down any five of the predominant features of Java.

  • Platform independent
  • Robust
  • Object oriented
  • Multi-threaded and
  • Interpreted

7. What is the significance of Synchronized Non-access Modifier in Java?

Apart from access modifiers, Java provides the Non-access modifier functionalities that can be synchronized. The main feature of these functionalities is that after synchronization there will be an indication that a method can be used by only one thread at a time.

8. What is Set Interface?

The Set Interface is a collection of elements primarily used to avoid duplicate elements. Methods that are inherited from the collection will only be present in the Set Interface which incorporates the restriction that duplicate elements should be prohibited.

9. Define JAR file.

JAR file is defined as Java Archive file and it combines two or more files into one. The Java classes will be confined within a library. The .JAR files will be built on Zipping file format with the .jar file extension.

10. Double value cannot be cast to a byte. True or false?

False. A double value can be cast to a byte.


24 X 7 Customer Support X

  • us flag 99999999 (Toll Free)
  • india flag +91 9999999