-
What are the characteristics of cookies?
The following are a list of characteristics of cookies:1.Cookies are only sent back to the server that created them and not to any other server.For example,if a cookie was created by the Web server of www.macromedia.com and sent to the client or the browser,the cookie can be sent back to the same server only.2.Cookies are only used by the server to find out the computer name,IP address or any other...
-
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...
-
-
What is the another name for native methods?
Foreign methods.
-
-
-
-
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.
-
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 |
-
-
If the array size is negative,what will happen?
If the array size is negative, a NegativeArraySizeException is thrown
-
Can a statement have a multiple labels?
yes.A statement can have multiple labels:ex:Label1: Label2: System.out.println("Mutliple labels. ");
-
-
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
-
-
-
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...
-
-
Java Interview Questions
Ans