1. Values A and B (logical thinking questions) cannot use other intermediate variables;
2. x = x + 1, and x + = 1; under what circumstances is not true and x = x + 1 is incorrect;
3. What is the final value of J?
Int J = 0;
For (INT I = 0; I <100; I ++)
{
J = J ++;
}
System. Out. println (j );
4. What are I and j to meet the conditions?
While (I <= J & I> = J & I! = J)
{
System. Out. println ("0000 ");
}
5. What is I to meet the conditions?
If (I! = 0 & I =-I)
{
System. Out. println (I );
}
6. For (INT I = 0; I <10; I ++)
{
User user = new user ();
}
How many user objects are generated in the memory?
---------------------------- Open the coating to see the answer ----------------------------
1.
Int A = 10, B = 20;
A = A + B;
B = A-B;
A = A-B;
System. Out. println ("A =" + A + "B =" + B );
2.
Short x = 1;
X + = 1;
X = x + 1;
The following prompt is displayed during compilation:
Test. Java: 5: possible loss of Precision
Locate: int
Required: short
X = x + 1;
^
1 error
3. j = 0
4.
Integer I = new INTEGER (0 );
Integer J = new INTEGER (0 );
While (I <= J & I> = J & I! = J)
{
System. Out. println ("OK ");
}
5.
Int I = integer. min_value;
If (I! = 0 & I =-I)
{
System. Out. println (I );
}
6. If JVM garbage collection is not considered, 10 user objects are generated.
Reprint from http://www.java3z.com/cwbwebhome/article/article8/81345.html? Id = 3464