+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Core Java Interview Questions and Answers

1
What is Annotation in Java?

An annotation, in the java programming language is a special form of syntactic metadata that can be added to Java Source Code.
Classes, methods, variables parameters and packages may be annotated.
Unlike Java doc tags, Java annotation are reflective, in that they are embedded in class files generated by the compiler and may be retained by the java VM to make retrievable at run-time. Annotation is basically to attach metadata to method, class or package. Metadata is used by the compiler to perform some basic compile-time checking

2
What is the most important feature of Java?

Java is a platform independent language.

3
What are the differences between the methods sleep() and wait()?
  • The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call.
  • The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.
4
How many types of memory areas are allocated by JVM?

Many types:

  1. Class(Method) Area
  2. Heap
  3. Stack
  4. Program Counter Register
  5. Native Method Stack
5
How many types of memory areas are allocated by JVM?

Many types:

  1. Class(Method) Area
  2. Heap
  3. Stack
  4. Program Counter Register
  5. Native Method Stack
Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US