-
-
What is the another name for native methods?
Foreign methods.
-
If the array size is negative,what will happen?
If the array size is negative, a NegativeArraySizeException is thrown
-
-
What are the legal modifiers to local inner classes?
Final or abstract but not both at the same time.
-
Whether the java uses call_by_value parameter passing strategy or call-by-reference parameter passing strategy?
The parameter passing strategy in Java is call-by-value and not call-by-reference, regardless of the type of the parameter.
-
What is the difference between actual parameters and formal parameters?
Actual parameters are parameters passed to the method when the method is invoked by a method call, and can vary from call to call. Formal parameters are parameters defined in the method definition.
-
How can we calculate the shift distance in shift operators?
The shift distance is calculated by AND-ing the value of the right-hand operand with a mask value of 0x1f (31) if the left-hand has the promoted type int, or using a mask value of 0x3f (63) if the left-hand has the promoted type long. This effectively means masking the five lower bits of the right-hand operand in the case of an int left-hand operand, and masking the six lower bits of the right-hand...
-
-
-
-
Explain the contexts in which binary numeric promotion applies?
Binary numeric promotion is applied in the following contexts:1.operands of the arithmetic operators *, /, %, +, and - 2.operands of the relational operators = 3.operands of the numerical equality operators == and != 4.operands of the integer bitwise operators &, ^, and |
-
What is binary numeric promotion states?
Binary numeric promotion implicitly applies appropriate widening primitive conversions so that a pair of operands have the broadest numeric type of the two, which is always at least int. Given T to be the broadest numeric type of the two operands, the operands are promoted as follows under binary numeric promotion.If T is broader than int, both operands are converted to T; otherwise, both operands...
-
Tell me the contexts in which the Unary numeric promotion is applied?
Unary numeric promotion is applied in the following contexts:1.operand of the unary arithmetic operators + and -2.operand of the unary integer bitwise complement operator ~ 3.during array creation; for example, new int[20], where the dimension expression (in this case 20) must evaluate to an int value 4.indexing array elements; for example, table['a'], where the index expression (in this case 'a')...
-
What is unary numeric promotion states?
Unary numeric promotion states thatIf the single operand of the operator has a type narrower than int, it is converted to int by an implicit widening primitive conversion; otherwise, it is not converted
-
-
-
-
Is garbage collection concept platform dependent/indepentdent?
Platform dependent.
-
Is thread concept platform dependent or independent?
Platform dependent.
Java Interview Questions
Ans