CCE 122 Java Interview Question (Marked)
CCE 122 Java Interview Question (Marked)
CCE 122 Java Interview Question (Marked)
6. \n will force a new line break in the output, \t will make a tab spacing in
the output, \’’ will_____?
A. allow quotation marks to be used inside strings.
B. allow backspace to be used inside strings.
C. allow return to be used inside strings.
D. allow back slash to be used inside strings.
15. Which following code can count the total number of elements in an
array?
A. arrayName.size
B. arrayName.length
C. arrayName.count
D. arrayName.length( )
class test{
private int x;
private int y;
test(int x, int y ){
this.x=x; // line1
this.y=y; // line2
}
}
class subtest extends test{
subtest(int x, int y) { //line3
int s = x + y;
super(x, y); // line4
}
}
……
A. line1
B. line2
C. line3
D. line4
90. Which following statement is not correct when connect two strings?
A. operator”+” can connect two StringBuffer objects.
B. operator”+” can connect two String objects.
C. append( ) can connect two StringBuffer objects.
D. concat( ) can connect two String objects.
91. Which following code can create an array with 3 empty strings?
A. String arr [3];
B. String arr [ ]={null, null, null};
C. String arr [ ]={“ “, “ “, “ “};
D. String arr [ ]=new String [3];
for (int i=0; i<3; arr[i++]=null);
92. Which following statement is not correct?
A. String class is a final class. It cannot have sub class.
B. String class is included in the package java.lang.
C. “ok”.equals(“ok”) will return true.
D. String a="ok", b="ok"; a.compareTo(b) will return true.
105. Which following object can use “throws” when exception occurred?
A. Event
B. Object
C. String
D. EOFException
111. If the size of a file myFile.txt is 100 bytes, then after running
File f=new File("myFile.txt");
System.out.print(f);