9-4 Code for Analysis
9-4 Code for Analysis
}
System.out.println(a); # 20
}
}
}
}
int a = 21;
int b = a;
System.out.println(b); #21
b += a;
System.out.println(b); #42
a *= a;
System.out.println(a); #441
}
}
int x = 0;
int y = 10;
do {
y--;
++x;
}
while (x < 5);
i. float = 10.5f;
int i = 0;
i = i++ + i;
System.out.println("I = "+i); #1
}
class Test {
int d, a = 2, b = 2;
d = a++ + ++b;
int a = 1, b = 1, c;
c = a++ + b;
a) -128 to 127
b) 0 to 256
c) 0 to 32767
d) 0 to 65535
13 . Which of these coding types is used for data type characters in Java?
a) ASCII
b) ISO-LATIN-1
c) UNICODE
System.out.print(Integer);
System.out.print(String);
15. Find the output of the following Program
class Test
{
public static void main(String [] args)
{
char ch = '\u0041';
System.out.println(ch); #A
}
a) true
b) false
c) 0
d) 1
int i = 7;
int j = -9;
double x = 72.3;
double y = 0.34;
}
}
# i is 7
j is -9
x is 72.3
y is 0.34