-
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 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...
-
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 |
-
-
-
-
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...
-
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.
-
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 are the legal modifiers to local inner classes?
Final or abstract but not both at the same time.
-
-
If the array size is negative,what will happen?
If the array size is negative, a NegativeArraySizeException is thrown
-
What is the another name for native methods?
Foreign methods.
-
-
-
-
Can a statement have a multiple labels?
yes.A statement can have multiple labels:ex:Label1: Label2: System.out.println("Mutliple labels. ");
-
How to disable one column in table.
I have one table, in which I want one column (contents )to be NON DELETABLE by user, while rest (contents)are editable and deletable.How to do that??keeping .setenabled(false) makes every column non deletable.
-
What are the checked Exceptions servlet service methodcan throw?
ServletException,IOException.
-
Java Interview Questions
Ans