Escolar Documentos
Profissional Documentos
Cultura Documentos
Select one:
a. 7
b. int
c. test
d. 6
Select one:
a. void test(){} void test(){}
b. . void test(int x){} void test(int y){}
c. All of the Choices
d. void test(int x){} void test(double x){}
What was the initial name of the Java programming language?
Select one:
a. None of the choices
b. NetBeans
c. C
d. Oak
e. Javad
Select one:
a. The code is not valid
b. true
c. false
d. “a”
Which of the following is not the feature of java?
Select one:
a. Platform independent
b. Robust
c. Static
d. Code Security
e. None of the Above
Select one:
a. class Person{}
b. public abstract class Person {}
c. public class Person {}
d. public final class Person {}
What did java generates after compiling the java source code?
Select one:
a. None of the choices
b. Byte Code
c. Class Code
d. Image file
e. Executable file
Select one:
a. javac HelloWorld.java
b. javac HelloWorld
c. java HelloWorld.java
d. java HelloWorld
Select one:
a. floating-point literal
b. All of the choices
c. double value
d. 3.1416
e. 12.0
int[] intArray = { 1, 2, 3, 5, 6, 7 };
System.out.print(intArray[x]);
}
Select one:
a. The given code is not valid
b. 12356
c. 765321
d. 123567
void main(){test(1.0);
test(1);}
System.out.print(x);
Select one:
a. 11
b. 1.0
c. 1.01.0
d. 1.01
Select one:
a. 3.4028235E+38F
b. 12345678910F
c. 2.23
d. 1.2345E+3
e. all of the choices
Select one:
a. <packageName>;
b. <packageName> package;
c. <modifier> package <packageName>;
d. package <packageName>;
What is floating-point literal?
Select one:
a. All of the choices
b. Can be express in scientific notation.
c. It could be double or float value.
d. By default it is double type.
e. An integer literal with decimal point.
Which of the following is a valid identifier?
Select one:
a. name
b. None of the choices
c. public
d. true
e. static
Select one:
a. javac HelloWorld.java
b. javac HelloWorld
c. java HelloWorld
d. java HelloWorld.java
What do you call a blueprint of an object?
Select one:
a. Constructor
b. Class
c. one of the choice
d. Object
e. Method
Select one:
a. 4
b. 6
c. 5
d. 7
What is the extension name of a Java Source code?
Select one:
a. java
b. j
c. javac
d. None of the choices
e. class
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. int num = scan.getInt();
c. int num = scan.nextLong();
d. None of the above
e. short num = scan.nextInt();
Which of the following is true about constructor?
Select one:
a. Constructors does not have any return value
b. It can only be called by using the new operator during class instantiation.
c. Constructors have the same name as the class
d. All of the choices
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:
a. display 1
b. display 1111
c. display 1234
d. display 111
int[] intArray = { 1, 2, 3, 5, 6, 7 };
Select one:
a. 5
b. 4
c. 7
d. 6
Select one:
a. None of the choices
b. void test(){} void test(){}
c. void test(int x){} void test(int y){}
d. void test(char x, int y){} void test(int x, char y){}
e. All of the Choices
What will be the value of x after executing this code for(int x=0; x<=11; x++) {} is run?
Select one:
a. 11
b. 12
c. 1
d. 10
Which of the following scenarios where an exception may occur?
Select one:
a. All of the choices
b. A user has entered an invalid data.
c. A network connection has been lost in the middle of communications or the JVM has run
out of memory.
d. A file that needs to be opened cannot be found.
Select one:
a. nextDouble()
b. nextShort()
c. nextLong()
d. None of the choices
e. nextInt()
The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:
a. Multithreaded
b. Robust
c. Code Security
d. Platform independent
Which of the following is a valid editor for java source code?
Select one:
a. Notepad
b. All of the choices
c. eclipse
d. BlueJ
e. NetBeans
It is the method of hiding certain elements of the implementation of a certain class?
Select one:
a. None of the choices
b. Class
c. Object Oriented
d. Object
e. Encapsulation
What is the index number of the last element of an array with 20 elements?
Select one:
a. 19
b. 21
c. 20
d. None of the choices
e. 0
From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[2]?
Select one:
a. 4
b. 3
c. 2
d. 1
Which of the following does not return numeric value?
Select one:
a. nextShort()
b. nextInt()
c. None of the above
d. nextLong()
e. nextDouble()
int z=0;
Select one:
a. None of the Choice
b. 128
c. 512
d. 1
e. 236
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. None of the choices
c. Runtime errors occur during run-time.
d. Runtime errors occur after compilation.
e. All of the choices
It is used to access the instance variables shadowed by the parameters.
Select one:
a. mutator method
b. method
c. this
d. accessor method
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.nextInt();
b. int num = scan.nextLong();
c. short num = scan.nextShort();
d. int num = scan.getInt();
Select one:
a. Robust
b. High Performance
c. Object Oriented
d. Platform independent
What will be the output if you execute this code:
System.out.println(a[1]);
Select one:
a. It will display the value of a[1].
b. It will produce an exception.
c. It will display nothing.
d. It will display “a[1]”.
What keyword is used to perform class inheritance?
Select one:
a. inherits
b. implements
c. None of the choices
d. extends
e. derives
Select one:
a. 1
b. return 1
c. test
d. int
It used to read values from class variables?
Select one:
a. None of the choices
b. Instance Variable
c. Mutator
d. Accessor
e. Method
Which of the following is not a java keyword?
Select one:
a. else
b. name
c. if
d. None of the choices
e. goto
Select one:
a. Generating bytecode
b. Reading bytecode
c. Interpreting bytecode
The feature of Java which makes it possible to execute several tasks simultaneously.
Select one:
a. Platform independent
b. Code Security
c. None of the choices
d. Robust
e. Multithreaded
do{
System.out.println("Hello World!");
while(true);
Select one:
a. Do nothing
b. print "Hello World" infinitely
c. print "Hello World"
d. The code will not run because of syntax error
43/50