Basic Java Interview Question and Answers

73. What is passed by ref and what by value?
  All Java method arguments are passed by value. However, Java does manipulate objects by reference, and all object variables themselves are references.
 
Your Name Your Email-ID
Your Answer
74. What do you mean by order of precedence and associativity?
 
  • Orders of precedence: It determines the order in which the operators in an expression should be evaluated.
  • Associativity: It determines whether an expression should be evaluated left to right or right to left.
 
Your Name Your Email-ID
Your Answer
75. What modifiers may be used with an inner class that is a member of an outer class?
  An inner class may be declared as public, protected, private, static, final or abstract.
 
Your Name Your Email-ID
Your Answer
76. What is an inner class?
  There are two types of inner class : Static and non static.
  • An inner class is a non static nested class. it has access to all of the variables and methods of its outer class and may refer to them directly, however, the reverse is not true.
  • Members of the inner class are known only within the scope of the inner class and may not be used by the outer class.
  • Nested inner classes cannot have the same name as the enclosing class.
 
Your Name Your Email-ID
Your Answer