Basic Java Interview Question and Answers

57. What is the difference between the Boolean& operator and the && operator?
  If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluate. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped. Operator & has no chance to skip both sides evaluation and && operator does. If asked why, give details as above.
 
Your Name Your Email-ID
Your Answer
58. How are this and super used?
  this is used to refers to the current object, instance. super is use to refer to the variables and methods of the superclass of the current object instance.
 
Your Name Your Email-ID
Your Answer
59. What is JIT?
 
  • JIT is Just In Time compiler for bytecode introduced (in Java 2) for on the fly compilation of bytecode into native code.
  • It is the part of the JVM. It compiles bytecode into executable code in real time, on a piece by piece, demand basis.
  • It is not possible to compile an entire Java program into executable code all once, because Java performs runtime checks that can be done only at run time.
 
Your Name Your Email-ID
Your Answer
60. Define Interface in Java?
  Interfaces are syntactically similar to classes, but they lack instance variables and their methods are declared without a body. An interface definition has two components – the interface declarations and the interface body.
interfaceDeclaration
{
interfaceBody
}
 
Your Name Your Email-ID
Your Answer