Q1-
1. class Ex1{
2. public static void main(String[] args) {
3. int a[][] = new int[3][];
4. a[1] = new int[]{1,2,3};
5. a[2] = new int[]{4,5};
6. System.out.print(a[1][1]);
7. }
8. }
Which is the output?
Ans
Q2.
Choose the three legal identifiers.
Ans:
Q3.
Given
1. class S{
2. public static void main(String [] args){
3. String s = "Java";
4. s.concat(" SE 6");
5. s.replace('6','7');
6. System.out.print(s);
7. }
8. }
What is the result?
AnsQ4.
In the following pieces of code, A and D will compile without any error. True or false?
A: StringBuffer sb1 = "abcd";
B: Boolean b = new Boolean("abcd");
C: byte b = 255;
D: int x = 0x1234;
E: float fl = 1.2;
Ans
No comments:
Post a Comment