Page:15
Below are the scanned copy of Kerala Public Service Commission (KPSC) Question Paper with answer keys of Exam Name ' Instructor Gr I (Engineering Colleges) in Information Technology & Computer Engineering' And exam conducted in the year 2022. And Question paper code was '091/2022'. Medium of question paper was in Malayalam or English . Booklet Alphacode was 'A'. Answer keys are given at the bottom, but we suggest you to try answering the questions yourself and compare the key along wih to check your performance. Because we would like you to do and practice by yourself.
091/22
65. Which of the following statements is/are true ?
51 : Every class is part of some package.
52 : All classes in a file are part of the same package.
53 : If no package is specified, the classes in the file go into java.lang package.
54 : If ೧೦ package is specified, a new package is created with folder name ‘custom’ and
the class is put in this package.
A) Only 51, 82 and 3 8) Only 51, 52 and 54
©) Only S2 and 53 D) Only 51 and 52
66. What will be the output of the following Java Program ?
public class Test1 {
public static long method(long n) {
if(n<50) n = method(n+5);
return (೧-2);
}
public static void main(String[] args) {
System.out.printin(Test1.method(35));
}
A) 48 B) 42 ௦) 28 D) 43
67. Consider the following program :
public class Test2 {
public static void main(String[] args) {
String str1 = new String(“abcd”);
String str2 = str1;
str2 = str2.concat(new String(“ef’));
System.out.print(str1 .concat(str2));
StringBuffer sb1 = new StringBuffer(“abcd”);
StringBuffer sb2 = sb1;
802 = sb2.append(new StringBuffer(‘“ef”));
System.out.print(sb1.append(sb2));
}
}
What will be the output ?
abcdabcdefabcdefabcdef
abcdefabcdefabcdefabcdef
abcdefabcdefabcdabcdef
Compilation Error
A 7