__________ is implemented in at least two classes with inheritance relationship.
Inheritance
None of the options
OverridingCorrect
Polymorphism
Overloading
Can we directly compile codes from NetBeans?
It depends, if there is a compiler embedded in NetBeans
No, we can only write codes in NetBeans
Yes, because we can call Java compiler from NetBeansCorrect
Both A and C are correct
Can we directly compile codes from notepad?
Yes, Because we can call Java compiler from notepad
It depends, if there is a compiler embedded in Notepad
Both A and C are correct
No, We can only write codes in NotepadCorrect
Declare a two-dimensional integer array named values of size 6 columns and 4 rows.
int[ ][ ] values=new int[4][6];Correct
int[ 6][4 ] values=new int;
int values=new int[6][4];
int[ ][ ] values=new int[6][4];
None of the above
Declare and initialize a double data type array named numbers with the following values: 23.35, 34.45, 56.77.
double[ ] numbers={2335, 3445, 5677};Correct
double[ ] numbers={"2335, 3445, 5677"};
None of the choices
double[3] numbers={2335, 3445, 5677};
Double[ ] number={2335, 3445, 5677};
From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[2]?
3Correct
From the array int[] intArray = { 1, 2, 3, 5, 6, 7 };, what is the value of intArray[3]?
5Correct
How many elements could be assigned to an array location with 5 columns and 3 rows?
5
15Correct
8
3
None of the choices
It is a template for creating an object?
None of the above
Object Oriented
Method
ClassCorrect
Encapsulation
It is the ability of an object to have many forms?
Abstraction
PolymorphismCorrect
Inheritance
Interface
None of the above
It is the method of hiding certain elements of the implementation of a certain class?
EncapsulationCorrect
Class
Object
None of the above
Object Oriented
It is used to access the instance variables shadowed by the parameters.
thisCorrect
It used to read values from class variables?
AccessorCorrect
JVM is responsible for
Generating bytecode
None of the Above
Compiling source code
Interpreting bytecodeCorrect
Reading bytecode
Multiple-Choice. Please select the best answer for the question. What will be the result if you execute this expression x=true ? 1 : 0;?
1Correct
0
false
true
none of the above
Multiple-Choice. Please select the best answer for the question.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);?
236
128
512
None of the aboveCorrect
1
Multiple-Choice. Please select the best answer for the question.Which is not a decision control structure?
switch
if else-if else
if else
None of the aboveCorrect
if
Multiple-Choice. Please select the best answer for the question.Which is not a repetition control structure?
loopCorrect
None of the above
do-while
for
while
Multiple-Choice. Please select the best answer for the question.Which of the following a valid Java identifier?
$id
id
id_1Correct
all of the above
_id
Multiple-Choice. Please select the best answer for the question.Which of the following has the correct form for an if statement?
none of the above
if boolean_expression
if { boolean_expression }
boolean_expression
if (boolean_expression)Correct
Multiple-Choice. Please select the best answer for the question.Which of the following is not a Java Literal?
Boolean value
Integer value
None of the aboveCorrect
Float value
Character value
Multiple-Choice. Please select the best answer for the question.Which of the following is not a primitive data type?
none of the above
int
byte
StringCorrect
double
Multiple-Choice. Please select the best answer for the question.Which statement will check if x is less than y?
if (x>y)?:
if (x<=y)
if (x<y);Correct
none of the above
if (x>y)
Since Java uses a virtual machine, what does that mean about the versatility of Java?
None of the Above
It can run most anywhere without modificationCorrect
Code Security
It is used almost exclusively on Intel platforms
It will run on Windows, Linux, Unix, but not Apple
The __________ keyword allocates memory for the array being declared.
newCorrect
array
int
intArray
None of the above
The feature of Java which makes it possible to execute several tasks simultaneously.
MultithreadedCorrect
The Java feature, "write once, run anywhere", is termed as
Object Oriented
None of the Above
Platform independentCorrect
High Performance
Robust
The length of an array is established when the array is created at __________.
None of the above
runtimeCorrect
initialization
compile time
declaration
True or False. Please select the best answer for the question.byte, short, int, and for are one of Java's Primitive data types.
True
FalseCorrect
True or False. Please select the best answer for the question.float is one of Java's Primitive data types
TrueCorrect
False
True or False. Please select the best answer for the question.for, while and do-while is part of Java's Repetition Control Structures
TrueCorrect
False
True or False. Please select the best answer for the question.Java is a simple, object-oriented, portable and robust computer language.
TrueCorrect
False
True or False. Please select the best answer for the question.Java is architecture neutral
TrueCorrect
False
True or False. Please select the best answer for the question.Java is secured
TrueCorrect
False
True or False. Please select the best answer for the question.Java SE is a Java Platform
TrueCorrect
False
True or False. Please select the best answer for the question.Java's control structures are branching, decision, and multithreaded.
True
FalseCorrect
True or False. Please select the best answer for the question.Portable is one of Java's control structures
True
FalseCorrect
True or False. Please select the best answer for the question.Repetition is one of Java's control structures
TrueCorrect
False
Use the __________ statement when traversing through arrays.
whilewhile loop
switch
do-while loop
for loopCorrect
none of the choices
What did java generates after compiling the java source code?
Byte CodeCorrect
What do you call a blueprint of an object?
Object
None of the above
ClassCorrect
Constructor
Method
What do you call a class that inherits a class?
Parent class
Class
Superclass
SubclassCorrect
None of the above
What do you call a variable that belong to the whole class?
None of the above
Class VariableCorrect
Class Method
Static Variable
Object Variable
What does Java generate after compiling the java source code?
Class Code
Image file
Executable file
None of the Above
Byte CodeCorrect
What is floating-point literal?
Can be express in scientific notation
All of the aboveCorrect
An integer literal with decimal point
By default it is double type
It could be double or float value
What is the correct statement to compile Java program in command line?
javac HelloWorld
java HelloWorldjava
javac HelloWorldjavaCorrect
java HelloWorld
What is the correct statement to run Java program in command line?
None of the Above
java HelloWorldCorrect
javac HelloWorldjava
java HelloWorldjava
javac HelloWorld
What is the correct statement to set javac path in command line?
None of the Above
set path=C:\Program Files\Java
All of the above
javac
set path
C:\Program Files\Java\jdk160_23\bin
path=C:\Program Files\Java\jdk160_23\binCorrect
What is the extension name of a Java Source code?
j
None of the Above
javaCorrect
class
javac
What is the index number of the last element of an array with 20 elements?
19Correct
What is the index number of the last element of an array with 30 elements?
29Correct
What is the input for Java Compiler?
Code
Byte Code
Native Code
Source CodeCorrect
None of the Above
What is the length of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };
6Correct
What is the maximum index of the array: int[] intArray = { 1, 2, 3, 5, 6, 7 };
5Correct
What is the name of this method: int test(){return 1;} ?
7
None of the choices
int
6
testCorrect
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]);}
765321Correct
12356
123567
The given code is not valid
none of the choices
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]);}
0000000000Correct
012356789
The given code is not valid
1235678910
none of the choices
What is the output of the code snippet below: void main(){test("11");test("1");} void test(String x){System.out.print(x + x);}
222
111111Correct
6
None of the choices
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]);}
765321Correct
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]);}
0000000000Correct
What is the output of the code snippet below: void main(){test(“11”);test(“1”);} void test(String x){System.out.print(x + x);}
111111Correct
What is the output of the code snippet below: void main(){test();test();} void test(){System.out.print("1");}
2
11Correct
3
1
None of the choices
What is the output of the code snippet below: void main(){test();test();} void test(){System.out.print(“1”);}
11Correct
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);}
1.01Correct
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);}
1010
None of the choices
11
10
101Correct
What is the result if we execute this: "a" instanceof String; ?
The code is not valid
false
trueCorrect
=E2=80=9Ca=E2=80=9D
None of the above
What is the result if we execute this: "a".equals("a");?
false
=E2=80=9Ca=E2=80=9D
trueCorrect
None of the above
The code is not valid
What is the result if we execute this: “a” instanceof String; ?
trueCorrect
What is the result if we execute this: “a”.equals(“a”);?
trueCorrect
What is the return type of this method: int test(){return 1;} ?
test()
1
None of the above
void
intCorrect
What is the return value of this method: int test(){return 1;} ?
test
All of the choices
int
return 1
1Correct
What is the return value of this method: public void sum(){int x=1;} ?
1
sum
none of the choices
voidCorrect
x
What keyword is used to perform class inheritance?
extendsCorrect
derives
inherits
implements
None of the above
What type of value does the nextLine() returns?
None of the above
Line
double
StringCorrect
long
What was the initial name for the Java programming language?