JVM Is Responsible For
JVM Is Responsible For
SELECT one:
B. Interpreting bytecode
The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:
b. Multithreaded Correct
The Java feature. Write once, run anywhere. Is termed as
Select one:
d. Platform independent Correct
What did java generates after compiling the java source code?
Select one:
c. Byte Code Correct
Which of the following we are not allowed to write java source code?
Select one:
e. None of the Above Correct
What is the extension name of a Java Source code?
Select one:
c. java Correct
What is the input for Java Compiler?
Select one:
d. Source Code Correct
Which of the following is rot the feature of java?
Select one:
e. Static Correct
When w the officially released of Java?
Select one:
d. 1995 Correct
What was the initial name for the Java programming language?
Select one:
d. Oak Correct
Can we directly compile codes from NetBeans?
Select one:
a. No, we can only write codes in NetBeans
b. Both A and C are correct.
c. Yes, because we can call Java corn peer from NetBeans Correct
Which of the following is true about Runtime errors:
Select one:
c. Runtime errors occur during run-time. Correct
Can we directly compile codes from notepad?
Select one:
a. Yes. Because we can call Java compiler from notepad
b. No. We can only write codes in notepad Correct
c. Both A and C are correct.
Which of the following we are not allowed to write java source code?
Select one:
a. None of the Above Correct
What will happen if we compile the statement below?
~System.out.println("Hello World!")
Select one:
d. There will be a syntax error after compilation. Correct
What is the correct statement to run Java program in command line?
Select one:
e. Java HelloWorld Correct
What is the correct statement to compile Java program in command line?
Select one:
b. javac HelloWorld.java Correct
Which of the following is true about syntax errors:
Select one:
a. You will have syntax errors if you misspell the Java command.
b. Incorrect capitalization leads to syntax error.
c. Syntax errors are usually typing errors.
d. All of the above. Correct
e. None of the Above
Why do we need to set the path for JavaC in command line?
Select one:
b. To make JavaC available or accessible in command line. Correct
What is the correct statement to set JavaC path in command line?
Select one.
b. C: Program Files\Java\jdk1 .6.0_23\bin Correct
Which of the following is not a primitive data type?
Select one:
e. String Correct
Which of the following is not a java keyword?
Select one:
a. name Correct
Which of the following is not a Java comment?
Select one:
e. Declaration Comments Correct
Which of the following is not a valid Float value?
Select one:
b. none of the above Correct
Which of the following is not a valid variable declaration In Java?
Select one
e. 1; Correct
Which of the following is not Java Literal?
Select one.
a. None of the above Correct
Which of the following a valid Java identifier?
Select one:
e. id_1 Correct
Which of the following is not an escape sequence?
d. none of the above Correct
Which of tie following is a valid identifier?
Select one:
e name Correct
What is floating-point literal?
Select one:
c. All of the above Correct
Which of the following is a valid statement to accept String input?
Select one.
d. String str = JOptionPane.showlnputDialog(""); Correct
Which of the followng is a valid nextByte() return value?
Select one.
c. 3 Correct
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. None of the above Correct
What type of value does the nextLine() returns?
Select one:
b. String Correct
What will happen if you use JOptionPane.showmessageDialog statement in your program?
Select one
b. The program will display message dialog box. Correct
Which of the following method reads input from the user and return String value?
Select one
d nextLine() Correct
Which of the following is a valid nextInt() return value?
Select one
a 1010 Correct
Which cite following does not return numeric value?
Select one:
d None of the above Correct
What will happen if you use JOptionPane.showInputDialog statement in your program?
Select one:
d. The program will display an input dialog box that allows the user to input text and returns String
value. Correct
Which of tie following is a valid nexDouble() return value?
Select one:
a. All of the above Correct
What will be the output if you execute this code?
do{System.outprintln("Hello World"):}while(false):
Select one
e. print "Hello World" Correct
Which is not a decision control structure?
Select one
e None of the above Correct
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=(xy)
Select one:
c. None of the above Correct
Which statement will check if x is equal to y?
Select one:
a. none of the above Correct
what will be the output if you execute this code?
Int x=1:
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:
b display 1111 Correct
do(System.out.printIn("HeIIo World!"):}while(true);
Select one:
d print "HelIo World" infiniteIy Correct
What will be the value of x after executing this code
for(int x=; x<=10: x++) {} is run?
Select one:
a. 11 Correct
Which statement will check if x is less than y?
Select one:
d. if (x<y); Correct
Which is not a repetition control structure?
Select one:
e. switch Correct
Which of the following has the correct form for an if statement?
Select one:
d. if (boolean_expression) Correct
Which of the following correctly accesses the sixth element stored in an array of 10 elements?
Select one.
e stringArray[5];
Which of the following is a valid multidimensional array?
Select one
c. all of the above Correct
Which of the following correctly accesses the sixth element stored in an array of 10 elements?
Select one:
c. stringArray(5]; Correct
What is the index number of the last statement of an array with 30 elements?
Select one:
d. 29 Correct
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.outprint(intArray[x]);}
Select one:
e. 765321 Correct
What is the output of the code snippet below:
int[] intArray = new int[10];
For(int x = 0; x<intArray.length; x++){System.out.print(intArray[x]);}
Select one:
c. 0000000000 Correct
Which of the following declares an array of int named intArray?
Select one
a. All of the above Correct
What is the maximum index of the array; int[] intArray = { 1, 2, 3, 5, 6, 7};
Select one:
d. 5 Correct
What is the length of the array: int[] intArray = {1, 2, 3, 5, 6, 7 };
Select one:
b. 6 Correct
From the array int[] intArray = {1, 2, 3, 5, 6, 7 );, what is the value of intArray[3]?
Select one:
a. 5 Correct
What is the output of the code snippet below:
void main(){test("11");test("1");}
void test(String x){System.out.print(x + x);}
Select one:
a 111111 Correct111
Which of the following shows a valid Overloading method?
Select one:
d. none of the choices Correct
What is the return value of this method pubIic void sum(){int x=1;} ?
Select one:
b. void Correct
Which of the following shows Oer1oading method?
Select one:
d. void test(int x){} void test(double x){} Correct
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:
e. 1.01 Correct
What is the return value of this method: int test(){retum 1;} ?
Select one:
e.1 Correct
What is the return type of this method: int test(){return 1;}?
Select one:
c. int Correct
What is the output of the code snippet below: void main(){test();test();} void test()
{System.out.print("1”);}
Select one:
a. 11 Correct
What is the name of this method: int test(){retum 1;} ?
Select one:
d. test Correct
Which of the following is a valid method name:
Select one:
b. compute Correct
Which of the following creates an instance of a class?
Select one:
e. All of the choices Correct
What is the result if we execute this: "a" .equals("a");?
Select one:
a. true Correct
What do you call a variable that belong to the whole class?
Select one:
e. Class Variable Correct
It is a template for creating an object?
Select one:
e. Class Correct
What is the result if we execute this: "a" instanceof String; ?
Select one:
b. true Correct
What do you call a blueprint of an object?
Select one:
d. Class Correct
What will be the value of x if we execute this: String s = "25"; int x = Integer.parselnt(s); ?
Select one:
a. int 25 Correct
Which of the following show casting object?
Select one:
a. All of the choices Correct
It is the method of hiding certain elements of the implementation of a certain class?
Select one:
b. Encapsulation Correct
Which of the following will do implicit cast?
Select one:
d. short x=1; int y = x; Correct
Which of the following class declaration is not allowed to be instantiated?
Select one:
b. public abstract class Person {} Correct
Which of the following method is allowed to be overriden?
Select one:
c. public final void setName(){} Correct
Which of the following is the correct way to call the constructor of the parent class?
Select one:
b. super() Correct
It is the ability of an object to have many forms?
Select one:
a. Polymorphism Correct
Which of the following is the correct way to use an interface?
Select one:
a. public class Person implements [InterfaceName] {} Correct
Which of the following class declaration is not allowed to be inherited?
Select one:
a. public final class Person {} Correct
Which of the following is the correct way to define an interface?
Select one:
c. public interface [InterfaceName] {} Correct
What keyword is used to perform class inheritance?
Select one:
b. extends Correct
What do you call a class that inherits a class?
Select one:
b. Subclass Correct
Which of the following is true about Interface?
Select one:
a. All of the above Correct