PMF Comprog 2 Finals
PMF Comprog 2 Finals
Select one:
a. There will be a runtime error after compilation.
b. There will be a logical error after compilation.
c. There will be no error after compilation.
d. There will be a syntax error after compilation.
Which of the following is not the feature of java?
Select one:
a. Robust
b. Static
c. None of these
d. Code Security
e. Platform independent
Which of the following is not the feature of java?
Select one:
a. None of the choices
b. Code Security
c. Static
d. Robust
e. Platform independent
Which of the following we are not allowed to write java source code?
Select one:
a. NetBeans
b. eclipse
c. None of these
d. BlueJ
e. Notepad
What was the initial name for the Java programming language?
Select one:
a. Java
b. Oak
c. C
d. NetBeans
Which of the following is not usable for writing java source code?
Select one:
a. NetBeans
b. BlueJ
c. eclipse
d. None of the choices
e. Notepad
What is the correct statement to set JavaC path in command line?
Select one:
a. path C:\Program Files\Java\jdk1.6.0_23\bin
b. < JavaC directory >
c. C:\Program Files\Java\jdk1.6.0_23\bin
d. All of the given choices are correct
e. set path
Which of the following is true about Runtime errors:
Select one:
a. Runtime errors occur after compilation.
b. Runtime errors occur during run-time.
c. All of the choices are correct
d. Runtime errors occur when there is a design flaw in your program
e. No correct answer
What is the correct statement to run Java program in command line?
Select one:
a. java HelloWorld
b. javac HelloWorld
c. java HelloWorld.java
d. javac HelloWorld.java
Which of the following is not usable for writing java source code?
Select one:
a. Notepad
b. None of the choices
c. eclipse
d. NetBeans
e. BlueJ
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Static
b. None of these
c. Robust
d. Code Security
e. Platform independent
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following we are not allowed to write java source code?
Select one:
a. None of the choices
b. Notepad
c. eclipse
d. NetBeans
e. BlueJ
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:
a. Platform independent
b. Robust
c. Code Security
d. Multithreaded
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. _id
b. id_1
c. all of the choices
d. $id
e. id
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. if
b. else
c. None of the choices
d. name
e. goto
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. $id
b. All of these
c. _id
d. id
e. id_1
Question 6
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. All of the statements are correct
b. An integer literal with decimal point.
c. It could be double or float value.
d. By default it is double type.
e. Can be express in scientific notation.
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. name
b. goto
c. if
d. else
e. None of the choices
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Native Code
b. Code
c. Source Code
d. Byte Code
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following we are not allowed to write java source code?
Select one:
a. BlueJ
b. NetBeans
c. None of the choices
d. eclipse
e. Notepad
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is not usable for writing java source code?
Select one:
a. Notepad
b. None of the choices
c. NetBeans
d. BlueJ
e. eclipse
Question 15
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Question 16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 19
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 22
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 26
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Can we directly compile codes from notepad?
Select one:
a. None of these
b. Yes, Because we can call Java compiler from notepad
c. No, We can only write codes in Notepad
d. It depends, if there is a compiler embedded in Notepad.
Question 27
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 28
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 29
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 30
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 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:
a. int num = scan.nextLong();
b. None of the choices
c. short num = scan.nextInt();
d. short num = scan.nextShort();
e. int num = scan.getInt();
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. display 1111
b. display nothing
c. display 1234
d. None of the above}
e. display 1
Feedback
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following method reads input from the user and return String value?
Select one:
a. nextText()
b. All of these
c. nextString()
d. nextValue()
e. nextLine()
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. none of the choices
b. if (boolean_expression)
c. if boolean_expression
d. if boolean_expression
e. boolean_expression
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. nextInt()
b. nextLong()
c. nextDouble()
d. nextShort()
e. None of these
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of these
b. if (x<>y)
c. if (x<y);
d. if (x>y)
e. if (x>y)?:
Feedback
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 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:
a. short num = scan.nextInt();
b. None of these
c. int num = scan.nextLong();
d. int num = scan.getInt();
e. short num = scan.nextShort(
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. floating-point literal
b. All of these
c. 3.1416
d. 12.0
e. double value
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?
Select one:
a. None of these
b. The program will display message dialog box.
c. The program will display message dialog box returns String value.
d. The program will display an input dialog box that allows the user to input text and
returns the correct type value.
e. The program will display an input dialog box that allows the user to input text and returns
String value.
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. if (x>y)
b. if (x<>y)
c. if (x<y);
d. if (x>y)?:
e. none of the above
Feedback
Your answer is correct.
Question 5
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Do nothing
b. None of the above.
c. print "Hello World" infinitely
d. print "Hello World"
e. The code will not run because of syntax error
Feedback
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 128
b. 1
c. 512
d. None of these
e. 236
Feedback
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. if (x<>y)
b. none of the choices
c. if (x!<y)
d. if (x>y)
e. if (y>y)
What is the index number of the last element of an array with 30 elements?
Select one:
a. 0
b. 30
c. 31
d. 29
e. None of the choices
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?
Select one:
a. intArray[10];
b. intArray[7];
c. stringArray[5];
d. intArray[6];
e. None of these
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 4
b. 5
c. none of the choices
d. 6
e. 7
Feedback
Flag question
Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?
Select one:
a. None of the choices
b. intArray[6];
c. intArray[7];
d. intArray[10];
e. stringArray[5];
Question 6
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
Select one:
a. 6
b. 7
c. None of the choices
d. 4
e. 5
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?
Select one:
a. intArray[7];
b. intArray[10];
c. intArray[6];
d. stringArray[5];
e. None of these
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?
Select one:
a. intArray[7];
b. stringArray[5];
c. None of the choices
d. intArray[6];
e. intArray[10];
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 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[3]?
Select one:
a. 5
b. 6
c. 4
d. 7
e. None of the choices
Feedback
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. none of the choices
b. if (y>y)
c. if (x!<y)
d. if (x>y)
e. if (x<>y)
Feedback
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?
Select one:
a. The program will display message dialog box.
b. The program will display an input dialog box that allows the user to input text and
returns String value.
c. None of these
d. The program will display an input dialog box that allows the user to input text and
returns the correct type value.
e. The program will display message dialog box returns String value.
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Do nothing
b. print "Hello World"
c. None of these
d. print "Hello World" infinitely
e. The code will not run because of syntax error
Feedback
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. floating-point literal
b. long value
c. 1010
d. 3.1416
e. None of the choices
Question 16
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Question 17
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. if (x>y)
b. if (x!<y)
c. None of these
d. if (y>y)
e. if (x<>y)
Feedback
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Which of the following correctly accesses the sixth element stored in an array of 10
elements?
Select one:
a. stringArray[5];
b. None of these
c. intArray[6];
d. intArray[10];
e. intArray[7];
Question 20
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. String num = scan.nextText();
b. None of the choices
c. String str = JOptionPane.showInputDialog("");
d. String str = scan.nextString();
e. string str = scan.nextShort();
Question 21
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Which of the following method reads input from the user and return String value?
Select one:
a. nextString()
b. All of these
c. nextValue()
d. nextText()
e. nextLine()
Question 22
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. Do nothing
b. None of the above.
c. The code will not run because of syntax error
d. print "Hello World" infinitely
e. print "Hello World"
Feedback
Your answer is correct.
Question 23
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?
Select one:
a. The program will display message dialog box returns String value.
b. The program will display message dialog box.
c. The program will display an input dialog box that allows the user to input text and returns
the correct type value.
d. The program will display an input dialog box that allows the user to input text and
returns String value.
e. None of the choices
Question 24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 26
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
What is the index number of the last element of an array with 30 elements?
Select one:
a. 30
b. None of the choices
c. 31
d. 29
e. 0
Question 28
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 1
b. 128
c. 512
d. 236
e. None of these
Question 30
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Question 31
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 32
Correct
Mark 2.00 out of 2.00
Flag question
Question text
What is the return value of this method: public void sum(){int x=1;} ?
Select one:
a. sum
b. void
c. 1
d. None of the choices
e. x
Feedback
Question 33
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. int
b. void
c. None of the above
d. test()
e. 1
Feedback
Question 34
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 35
Incorrect
Mark 0.00 out of 1.00
Flag question
Question text
What will happen if you use JOptionPane.showMessageDialog statement in your program?
Select one:
a. The program will display message dialog box returns String value.
b. The program will display message dialog box.
c. The program will display an input dialog box that allows the user to input text and returns
String value.
d. None of the choices
e. The program will display an input dialog box that allows the user to input text and returns
the correct type value.
Question 36
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 37
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. The given code is not valid
b. None of the choices
c. 012356789
d. 1235678910
e. 0000000000
Feedback
Question 38
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. void test(int x){} void test(int y){}
b. none of the choices
c. All of the choices
d. void test(){} void test(){}
e. void test(char x, int y){} void test(int x, char y){}
Feedback
Question 39
Correct
Mark 1.00 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[3]?
Select one:
a. 7
b. 4
c. 6
d. 5
e. None of the choices
Feedback
Question 40
Correct
Mark 2.00 out of 2.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:
a. int num = scan.getInt();
b. int num = scan.nextLong();
c. None of the choices
d. short num = scan.nextInt();
e. short num = scan.nextShort();
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Class
b. Method
c. Constructor
d. Object
e. None of the choices
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Object Oriented
b. Class
c. None of these
d. Object
e. Encapsulation
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of these
b. false
c. true
d. “a”
e. The code is not valid
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will be the value of x if we execute this: String s = "25"; int x = Integer.parseInt(s); ?
Select one:
a. None of the choices
b. 0
c. int 25
d. The code is not valid.
e. String 25
Feedback
Flag question
Question text
Select one:
a. SuperClass sc = new SuperClass(); SubClass sbc = new SubClass(); sbc = (SubClass) sc;
b. All of the choices
c. (className) object;
d. Employee emp = new Employee(); VicePresident veep = new VicePresident(); veep =
(VicePresident)emp;
Feedback
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will be the value of x if we execute this: String s = "25"; int x = Integer.parseInt(s); ?
Select one:
a. None of the choices
b. String 25
c. The code is not valid.
d. int 25
e. 0
Feedback
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. Static Variable
b. None of the choices
c. Class Method
d. Object Variable
e. Class Variable
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will be the value of x if we execute this: String s = "25"; int x = Integer.parseInt(s); ?
Select one:
a. None of these
b. int 25
c. The code is not valid.
d. 0
e. String 25
Feedback
Flag question
Question text
Select one:
a. display 1
b. display 1111
c. None of these
d. display 1234
e. display nothing
Feedback
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?
Select one:
a. The program will display an input dialog box that allows the user to input text and returns
the correct type value.
b. The program will display an input dialog box that allows the user to input text and
returns String value.
c. The program will display message dialog box.
d. The program will display message dialog box returns String value.
e. None of these
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following method reads input from the user and return String value?
Select one:
a. nextValue()
b. nextString()
c. All of the above
d. nextText()
e. nextLine()
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following method reads input from the user and return String value?
Select one:
a. nextText()
b. All of these
c. nextLine()
d. nextValue()
e. nextString()
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Do nothing
b. print "Hello World"
c. The code will not run because of syntax error
d. print "Hello World" infinitely
e. None of these
Feedback
Flag question
Question text
Select one:
a. String
b. long
c. Line
d. None of these
e. double
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. long
b. Line
c. None of the choices
d. double
e. String
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. if (x>y)
b. if (x<y);
c. if (x>y)?:
d. none of the above
e. if (x<>y)
Feedback
Your answer is correct.
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the index number of the last element of an array with 30 elements?
Select one:
a. 31
b. None of the choices
c. 30
d. 0
e. 29
Question 16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. print "Hello World" infinitely
b. None of the above.
c. The code will not run because of syntax error
d. print "Hello World"
e. Do nothing
Feedback
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 765321
b. The given code is not valid
c. 123567
d. None of these
e. 12356
Feedback
Question 19
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which statement will check if x is less than y?
Select one:
a. None of these
b. if (x>y)?:
c. if (x>y)
d. if (x<y);
e. if (x<>y)
Feedback
Question 20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. if (boolean_expression)
b. boolean_expression
c. if boolean_expression
d. if boolean_expression
e. none of the choices
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of the choices
b. print "Hello World" infinitely
c. Do nothing
d. The code will not run because of syntax error
e. print "Hello World"
Feedback
Question 22
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will happen if you use JOptionPane. showInputDialog statement in your program?
Select one:
a. The program will display message dialog box returns String value.
b. The program will display an input dialog box that allows the user to input text and
returns String value.
c. None of the choices
d. The program will display message dialog box.
e. The program will display an input dialog box that allows the user to input text and returns
the correct type value.
Question 23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. if (x<>y)
b. if (x>y)
c. if (x!<y)
d. if (y>y)
e. None of these
Feedback
Question 24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. display nothing
b. display 1
c. display 1234
d. display 1111
e. None of the above}
Feedback
Question 26
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. none of the choices
b. if (x!<y)
c. if (x<>y)
d. if (x>y)
e. if (y>y)
Feedback
Question 27
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 28
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 29
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is a valid nexDouble() return value?
Select one:
a. 12.0
b. All of the choices
c. floating-point literal
d. 3.1416
e. double value
Question 30
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 31
Correct
Mark 1.00 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[3]?
Select one:
a. None of the choices
b. 4
c. 7
d. 6
e. 5
Feedback
Question 32
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 33
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 34
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. long value
b. floating-point literal
c. 1010
d. None of these
e. 3.1416
Question 35
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 36
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 37
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What will be the value of x after executing this code
for(int x=0; x<=10; x++) {} is run?
Select one:
a. 0
b. 1
c. 11
d. 10
e. None of these
Feedback
Question 38
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 39
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the index number of the last element of an array with 30 elements?
Select one:
a. 29
b. None of these
c. 30
d. 31
e. 0
Question 40
Correct
Mark 1.00 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:
a. short num = scan.nextInt();
b. None of these
c. int num = scan.nextLong();
d. int num = scan.getInt();
e. short num = scan.nextShort();
Question 41
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 42
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 43
Correct
Mark 1.00 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:
a. short num = scan.nextShort();
b. None of the choices
c. short num = scan.nextInt();
d. int num = scan.getInt();
e. int num = scan.nextLong();
Question 44
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 45
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 46
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 47
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 48
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. print "Hello World"
b. None of these
c. Do nothing
d. print "Hello World" infinitely
e. The code will not run because of syntax error
Feedback
Flag question
Question text
Select one:
a. 10
b. 11
c. 1
d. 0
e. none of the above
Feedback
Question 50
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of the choices
b. if else-if else
c. if else
d. switch
e. if
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Static Variable
b. None of the choices
c. Class Variable
d. Class Method
e. Object Variable
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. String x = “0”; int y = x;
b. None of the choices
c. All of the choices
d. Object obj = new Object();
e. short x=1; int y = x;
Feedback
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. Class
b. Constructor
c. None of the choices
d. Object
e. Method
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of the choices
b. Encapsulation
c. Class
d. Object Oriented
e. Method
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public final class Person {}
b. class Person{}
c. public abstract class Person {}
d. public class Person {}
e. None of these
Feedback
Flag question
Question text
Select one:
a. extends
b. inherits
c. implements
d. derives
e. None of the choices
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. implements
b. extends
c. inherits
d. derives
e. None of these
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. It defines the signatures of a set of methods without the body
b. It is a special kind of block containing method signatures only
c. It defines a standard and public way of specifying the behavior of classes
d. All of the statements are correct
e. It is use to model multiple inheritance which allows a class to have more than one
superclass.
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Parent class
b. Class
c. None of these
d. Subclass
e. Superclass
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public class Person implements [InterfaceName] {}
b. None of the choices
c. public class Person use [InterfaceName] {}
d. public class Person apply [InterfaceName] {}
e. public class Person extends [InterfaceName] {}
Feedback
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is the correct way to call the constructor of the parent class?
Select one:
a. super()
b. super.call()
c. this()
d. this.call()
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of the choices
b. public void setName(){}
c. public final void setName(){}
d. public static void setName(){}
e. public no_override void setName(){}
Feedback
Flag question
Question text
Select one:
a. It defines a standard and public way of specifying the behavior of classes
b. It defines the signatures of a set of methods without the body
c. All of these
d. It is use to model multiple inheritance which allows a class to have more than one
superclass.
e. It is a special kind of block containing method signatures only
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. derives
b. inherits
c. None of these
d. implements
e. extends
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Polymorphism
b. None of these
c. Inheritance
d. Abstraction
e. Interface
Question 1
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public class Person {}
b. class Person{}
c. public abstract class Person {}
d. public final class Person {}
Feedback
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. You will have syntax errors if you misspell the Java command.
b. Syntax errors are usually typing errors.
c. Incorrect capitalization leads to syntax error.
d. All of the above.
e. None of the choices
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What did java generates after compiling the java source code?
Select one:
a. Image file
b. Executable file
c. Class Code
d. Byte Code
e. None of the choices
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 8
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. public
b. None of the choices
c. static
d. true
e. name
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 10
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. Can be express in scientific notation.
b. An integer literal with decimal point.
c. It could be double or float value.
d. All of the choices
e. By default it is double type.
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 14
Correct
Mark 2.00 out of 2.00
Flag question
Question text
Select one:
a. void test(int x){} void test(double x){}
b. void test(){} void test(){}
c. All of the Choices
d. . void test(int x){} void test(int y){}
Feedback
Question 15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 11
b. 1.01.0
c. 1.01
d. 1.0
Feedback
Question 16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is true about Runtime errors
Select one:
a. Runtime errors occur when there is a design flaw in your program
b. All of the choices
c. Runtime errors occur after compilation.
d. Runtime errors occur during run-time.
e. None of the choices
Question 19
Correct
Mark 1.00 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:
a. 12
b. 1
c. 10
d. 11
Feedback
Question 20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Method
b. Constructor
c. one of the choice
d. Class
e. Object
Question 22
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 23
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 24
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 25
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 26
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. BlueJ
b. NetBeans
c. eclipse
d. Notepad
e. All of the choices
Question 27
Correct
Mark 2.00 out of 2.00
Flag question
Question text
The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:
a. None of the choices
b. Multithreaded
c. Code Security
d. Platform independent
e. Robust
Question 29
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Flag question
Question text
Select one:
a. name
b. goto
c. if
d. None of the choices
e. else
Question 31
Correct
Mark 1.00 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:
a. 20
b. 21
c. 19
d. 0
e. None of the choices
Question 32
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. 12356
b. The given code is not valid
c. 765321
d. 123567
Feedback
Question 33
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 35
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 36
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 37
Correct
Mark 1.00 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:
a. 2
b. 4
c. 1
d. 3
Feedback
Question 38
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Object
b. Class
c. Encapsulation
d. None of the choices
e. Object Oriented
Question 40
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 41
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Runtime errors occur during run-time.
b. All of the choices
c. Runtime errors occur when there is a design flaw in your program
d. Runtime errors occur after compilation.
Question 42
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. floating-point literal
b. All of the choices
c. 3.1416
d. double value
e. 12.0
Question 44
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 45
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. It will display “a[1]”.
b. It will display the value of a[1].
c. It will produce an exception.
d. It will display nothing.
Which of the following is a valid statement to accept int input? Let us assume that we have
declared scan as Scanner.
Select one:
a. int num = scan.getInt();
b. short num = scan.nextShort();
c. int num = scan.nextLong();
d. int num = scan.nextInt();