ITE6104 Computer Programming 2 ( Final Exam )
Question 1
Question text
Question 2
Question text
What is the name of this method: int test(){return 1;} ?
Question 3
Question text
What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };
Question 4
Question text
The Java feature, "write once, run anywhere", is termed as
Question 5
Question text
Question 6
Question text
What is the function of JVM?
Question 7
Question text
What is the correct statement to compile Java program in command line?
Question 8
Question text
Which of the following is a valid nexDouble() return value?
Question 9
Question text
What will be the output if you execute this code:
int a[] = new int[1];
System.out.println(a[1]);
Question 10
Question text
Question 11
Question text
Which of the following shows Overloading method?
Question 12
Question text
Question 13
Question text
Which of the following class declaration is not allowed to be inherited?
Question 14
Question text
What will be the output if you execute this code?
do{
System.out.println("Hello World!");
}
while(true);
Question 15
Question text
Question 16
Question text
Question 17
Question text
Question 18
Question text
Which of the following is the correct syntax to define a method?
Question 19
Question text
Question 20
Question text
Question 21
Question text
Question 22
Question text
Question 23
Question text
what will be the output if you execute this code?
int x=2;
switch(x){
case 1:
System.out.print(“1”);
case 2:
System.out.print(“1”);
case 3:
System.out.print(“1”);
default:
System.out.print(“1”);
}
Question 24
Question text
Question 25
Question text
What is the return value of this method: int test(){return 1;} ?
Question 26
Question text
Question 27
Question text
What is the output of the code snippet below:
int[] intArray = { 1, 2, 3, 5, 6, 7 };
for(int x = intArray.length-1; x>=0; x--){
System.out.print(intArray[x]);
}
Question 28
Question text
From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[2]?
Question 29
Question text
Which of the following does not return numeric value?
Question 30
Question text
What is the maximum index of the array:
int[] intArray = { 1, 2, 3, 5, 6, 7 };
Question 31
Question text
Question 32
Question text
Which of the following is a valid statement to accept int input? Let us assume that we have declared scan as Scanner.
Question 33
Question text
Question 34
Question text
Question 35
Question text
What is the correct statement to run Java program in command line?
Question 36
Question text
What is the output of the code snippet below:
void main(){test(1.0);
test(1);}
void test(double x){
System.out.print(x);
void test(int x){System.out.print(x);}
Question 37
Question text
What will be the value of x after executing this code for(int x=0; x<=11; x++) {} is run?
Question 38
Question text
What will be the value of x after you execute this statement
int z=0;
for(int x=0; x<10; x++)
for(int y=0; y<x; y++) z*=(x*y);
Question 39
Question text
Question 40
Question text
Which of the following shows a valid Overloading method?
Question 41
Question text
Which of the following is not a valid Float value?
Question 42
Question text
What is the result if we execute this: “a”.equals(“a”);?
Question 43
Question text
Question 44
Question text
Question 45
Question text
Which of the following is a valid multidimensional array?