Long Quiz Java
Long Quiz Java
A. .class
B. .java
C. .xml
7. What's the common term for an error within a computer program's code that prevents it from
functioning properly?
A. A glitch
B. A hack
C. A bug
Discuss
A.
B.
Designing the application based on the objects discovered when analysing the problem
C.
Writing an algorithm before writing your program and having a test plan
D.
2.
A.
Is accessible publicly
B.
C.
D.
3.
Discuss
A.
B.
C.
Class and object are just different names for the same thing
D.
An object is a variable, where its type is the class used to declare the variable
4.
A.
Description
B.
Methods
C.
D.
Name
5.
A.
B is a sub-class of A
B.
A is a super-class of B
C.
D.
6.
A.
An attribute
B.
A method
C.
Attribute or method
D.
A sub-class
A.
Anything
B.
An algorithm
C.
A data container
D.
A program
10.
A class is...
A.
An object
B.
D.
A variable
A.
B.
C.
Ar.length
D.
Ar.length - 1
22.
What would display from the following statements? int [ ] nums = {1,2,3,4,5,6};
System.out.println((nums[1] + nums[3]));
A.
B.
2+4
C.
1+3
D.
23.
What loop will display each of the numbers in this array on a separate line: float [ ] nums= {1.1f, 2.2f,
3.3f};
A.
B.
For (i = 1; i
C.
For (i = 0; i
D.
24.
What displays from the following statements? String word = "abcde"; for (int i = 0; i <4; i+=2)
System.out.print(word[i]);
Discuss
A.
Ab
B.
Ac
C.
Ace
D.
Bd
25.
Discuss
A.
B.
C.
D.
26.
A.
B.
3
C.
D.
27.
Given the declaration int [ ] nums = {8, 12, 23, 4, 15}, what expression will display the first element in the
array (ie the number 8)
A.
B.
C.
D.
28.
An array holds:
Discuss
A.
B.
Different values of same data type
C.
D.
29.
A.
B.
C.
D.
Size of array
30.
Discuss
A.
B.
Perform different operations on each element in array
C.
D.
31.
A.
B.
C.
D.
38.
Discuss
A.
Int
B.
String
C.
Double
D.
Boolean
39.
A.
Int
B.
Double
C.
String
D.
Boolean
40.
A.
Int
B.
Double
C.
String
D.
Boolean
41.
A.
Int
B.
Double
C.
Boolean
D.
String
42.
A.
Int
B.
Double
C.
Char
D.
String
43.
Discuss
A.
String
B.
Boolean
C.
Int
D.
Char
44.
A.
Boolean
B.
Int
C.
Char
D.
Double
45.
A.
String
B.
Int
C.
Char
D.
Double
46.
Discuss
A.
Double
B.
Char
C.
Boolean
D.
Int
47.
A.
Char
B.
String
C.
Double
D.
Boolean
48.
A.
Double
B.
Boolean
C.
String
D.
Int
49.
A.
B.
C.
D.
A.
This
B.
New
C.
Sync
D.
New()
75.
Discuss
A.
B.
C.
D.
A.
Windows
B.
Unix/Linux
C.
Mac
D.
A.
B.
C.
D.
83.
A.
VariableName variableType;
B.
VariableName;
C.
VariableType;
D.
VariableType variableName;
84.
A.
B.
Assigning a multiplication
C.
D.
85.
What will be the value of “num” after the following statements? int num; num = (5+4); num = num / 9;
num = 9;
A.
B.
C.
D.
Num
86.
If you want your conditional to depend on two conditions BOTH being true, what is the proper notation
to put between the two Boolean statements ?
A.
&
B.
&&
C.
D.
||
87.
Which of the following means that in order for the conditional to happen, either x must be less than 3 or
y must be greater than or equal to 4 ?
A.
B.
If (x < 3 y >= 4)
C.
88.
What is a loop ?
A.
B.
C.
D.
A.
Initialization
B.
Loop Body
C.
Test statement
D.
The word "while"
91.
In a ‘for’ loop, what section of the loop is not included in the parentheses after “for” ?
A.
Initialization
B.
Loop Body
C.
Test statement
D.
Update
92.
Discuss
A.
B.
C.
Public functions can be used by anyone, private can only be used by other code in the class you are
writing
D.
Tim Ritchey
James Gosling
Jim LeValley
Ian Sheeler
B.
Platform
C.
Both Programming Language and Platform
D.
Abstract Machine
2.
Java Is Structured Programming Language.
Discuss
A.
True
B.
False
3.
Which of the following are legal identifiers in Java?
Discuss
A.
1abc
B.
Abc_1
C.
OneAbc
D.
Final
E.
$while
5.
Which of the following is a correct declaration of variable in Java ?
A.
Int num
B.
Int-num
C.
Int num;
D.
Int-num;
6.
Which of the following is a correct variable initialization in Java ?
A.
Int num = 10
B.
Int-num = 10
C.
Int num = 10;
D.
Int-num = 10
7.
What is the default value of the data type byte in Java ?
A.
0
B.
Null
C.
1
D.
None of the above
8.
What is the default value of the data type int in Java ?
A.
1
B.
0
C.
0i
D.
None of the above
9.
What is the default value of the data type long in Java ?
A.
0
B.
1
C.
0L
D.
10
One of the following is regarded as one of the most powerful basic data structures?
A.
Array
B.
Tree
C.
Stack
D.
Queue
2.
A string can be referred to as a sequence of
A.
Numbers
B.
Characters
C.
Letters
D.
All of the above
3.
JDBC is an acronym of
A.
Java Database Connectivity
B.
Joint Development Control
C.
Joint Database Connection
D.
Java Database Code
4.
One of the following is not true about threads
A.
Threads exists as a subset of a process
B.
Multiple threads can exist within one process, executing concurrently
C.
Threads have separate address spaces
D.
Systems with a single processor generally do not implement multithreading
5.
Who designed Java?
A.
Mike Sheridan
B.
Patrick Naughton
C.
Brendan Eich
D.
James Gosling
6.
Java was initially called
A.
Gosl
B.
Green
C.
Jave
D.
Oak
7.
Java can be said to be
A.
Concurrent
B.
Class-based
C.
Object-oriented
D.
All of the above
8.
The latest Java version of java was released on
A.
October 22, 2017
B.
September 21, 2017
C.
Decembe 11, 2017
D.
March 21, 2017
9.
The following were the primary goals of the java language except
A.
It must be stringed, coded, and encrypted
B.
It must be simple, object-oriented, and familiar
C.
It must be architecture-neutral and portable
D.
It must be interpreted, threaded, and dynamic
10.
In Java, programs are compiled into
A.
Java source code
B.
Pseudo code
C.
Bytecode
D.
Machine code
11.
In order for Java programs to be executed, it must be compiled how many times?
A.
Twice
B.
Once
C.
Thrice
D.
None of these