Basic Java Interview Question and Answers

9. Why classes in Java are immutable?
  All wrapper classes in java.lang are immutable
  • String
  • Integer
  • Boolean
  • Character
  • Byte
  • Short
  • Long
  • Float
  • Double
  • Big Decimal
  • Big Integer
 
Your Name Your Email-ID
Your Answer
10. What is the difference between static and non static variables?
 
  • A static variable is associated with the class as a whole rather than with specific instances of a class.
  • Non static variables take on unique values with each object instance.
 
Your Name Your Email-ID
Your Answer
11. What is a JVM consists of?
 
  • Each time of a Java Application is executed then an instance of JVM, responsible for its running, is created.
  • A JVM instance is described in terms of subsystems, memory areas, data types, and instructions.
 
Your Name Your Email-ID
Your Answer
12. Do multiple inheritance in Java?
 
  • It's not possible directly.
  • That means this features is not provided by Java, but it can be achieved with the help of Interface.
  • By implementing more than one interface.
 
Your Name Your Email-ID
Your Answer