ITE6104 Computer Programming 2 ( Final Exam )

ITE6104 Computer Programming 2 ( Final Exam )

 

Question 1

Answer saved
Marked out of 2.00
Flag question

Question text

What is the extension name of a Java Source code?
Select one:

Question 2

Answer saved
Marked out of 1.00
Flag question

Question text

What is the name of this method: int test(){return 1;} ?

Select one:

Question 3

Answer saved
Marked out of 1.00
Flag question

Question text

What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:

Question 4

Answer saved
Marked out of 1.00
Flag question

Question text

The Java feature, "write once, run anywhere", is termed as

Select one:

Question 5

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is true about Runtime errors
Select one:

Question 6

Answer saved
Marked out of 1.00
Flag question

Question text

What is the function of JVM?

Select one:

Question 7

Answer saved
Marked out of 1.00
Flag question

Question text

What is the correct statement to compile Java program in command line?

Select one:

Question 8

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is a valid nexDouble() return value?

Select one:

Question 9

Answer saved
Marked out of 1.00
Flag question

Question text

What will be the output if you execute this code:

int a[] = new int[1];

System.out.println(a[1]);

Select one:

Question 10

Answer saved
Marked out of 1.00
Flag question

Question text

What was the initial name of the Java programming language?
Select one:

Question 11

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following shows Overloading method? 

Select one:

Question 12

Answer saved
Marked out of 1.00
Flag question

Question text

What did java generates after compiling the java source code?
Select one:

Question 13

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following class declaration is not allowed to be inherited?

Select one:

Question 14

Answer saved
Marked out of 1.00
Flag question

Question text

What will be the output if you execute this code?

do{

System.out.println("Hello World!");

}

while(true);

Select one:

Question 15

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is a valid identifier?
Select one:

Question 16

Answer saved
Marked out of 2.00
Flag question

Question text

The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:

Question 17

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following scenarios where an exception may occur?
Select one:

Question 18

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is the correct syntax to define a method?

Select one:

Question 19

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is a valid editor for java source code?
Select one:

Question 20

Answer saved
Marked out of 1.00
Flag question

Question text

It is the method of hiding certain elements of the implementation of a certain class?
Select one:

Question 21

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is true about syntax errors:
Select one:

Question 22

Answer saved
Marked out of 1.00
Flag question

Question text

It is used to access the instance variables shadowed by the parameters.
Select one:

Question 23

Answer saved
Marked out of 1.00
Flag question

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”);

}

Select one:

Question 24

Answer saved
Marked out of 1.00
Flag question

Question text

What do you call a blueprint of an object?
Select one:

Question 25

Answer saved
Marked out of 1.00
Flag question

Question text

What is the return value of this method: int test(){return 1;} ?

Select one:

Question 26

Answer saved
Marked out of 1.00
Flag question

Question text

What is the index number of the last element of an array with 20 elements?
Select one:

Question 27

Answer saved
Marked out of 1.00
Flag question

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]);

}

 

Select one:

Question 28

Answer saved
Marked out of 1.00
Flag question

Question text

From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[2]?

Select one:

Question 29

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following does not return numeric value?

Select one:

Question 30

Answer saved
Marked out of 1.00
Flag question

Question text

What is the maximum index of the array:

int[] intArray = { 1, 2, 3, 5, 6, 7 };

Select one:

Question 31

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is not a java keyword?
Select one:

Question 32

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is a valid statement to accept int input? Let us assume that we have declared scan as Scanner.

Select one:

Question 33

Answer saved
Marked out of 2.00
Flag question

Question text

Which of the following is true about constructor?
Select one:

Question 34

Answer saved
Marked out of 1.00
Flag question

Question text

What is floating-point literal?
Select one:

Question 35

Answer saved
Marked out of 1.00
Flag question

Question text

What is the correct statement to run Java program in command line?

Select one:

Question 36

Answer saved
Marked out of 1.00
Flag question

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);}

Select one:

Question 37

Answer saved
Marked out of 1.00
Flag question

Question text

What will be the value of x after executing this code for(int x=0; x<=11; x++) {} is run?

Select one:

Question 38

Answer saved
Marked out of 1.00
Flag question

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);

Select one:

Question 39

Answer saved
Marked out of 2.00
Flag question

Question text

What keyword is used to perform class inheritance?
Select one:

Question 40

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following shows a valid Overloading method? 

Select one:

Question 41

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is not a valid Float value?

Select one:

Question 42

Answer saved
Marked out of 1.00
Flag question

Question text

What is the result if we execute this: “a”.equals(“a”);?

Select one:

Question 43

Answer saved
Marked out of 1.00
Flag question

Question text

It used to read values from class variables?
Select one:

Question 44

Answer saved
Marked out of 2.00
Flag question

Question text

Which of the following is not a primitive data type?
Select one:

Question 45

Answer saved
Marked out of 1.00
Flag question

Question text

Which of the following is a valid multidimensional array?

Select one: