This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Java Mock Test I Answer : C ExplainationCorrect syntax is public static void main(String[] args).
Answer : B ExplainationBoolean is a class and is not a keyword.
Answer : A ExplainationA class is a blue print from which individual objects are created. A class can contain fields and methods to describe the behavior of an object.
Answer : A ExplainationPrimitive variables like int, float are stored on Stack.
Answer : B ExplainationObjects are allocated memory in heap memory space.
Answer : A ExplainationTrue, Static functions can be accessed via class name or via null reference.
Answer : B ExplainationTrue, Compile time error will occur if an int variable is compared with Boolean variable.
Answer : D ExplainationLocal variables are not assigned any value by default.
Answer : C ExplainationInstance variables are assigned default values based on their types. For example, int variable is assigned 0 and an object type variable is assigned null as default value.
Answer : A ExplainationThe byte data type is represented by an 8-bit signed two's complement integer.
Minimum value: -128
Maximum value: 127
Answer : B ExplainationThe short data type is represented by 16-bit signed two's complement integer.
Minimum value: -32,768
Maximum value: 32,767
Answer : C ExplainationThe int data type is represented by 32-bit signed two's complement integer,
Minimum value: -231
Maximum value: 231-1
Answer : D ExplainationThe long data type is represented by 64-bit two's complement integer.
Minimum value: -263
Maximum value: 263-1
Answer : C ExplainationThe float data type is represented by single-precision 32-bit IEEE 754 floating point.
Answer : D ExplainationThe double data type is represented by double-precision 64-bit IEEE 754 floating point.
Answer : B ExplainationThe char data type is represented by single 16-bit Unicode character.
Minimum value: '\u0000' (or 0)
Maximum value: '\uffff' (or 65,535)
Answer : B ExplainationThe boolean data type can take either true or false, but its "size" isn't precisely defined.
Answer : A ExplainationTrue, an empty .java file is a valid source file.
Answer : A ExplainationTrue, a java file can contain one public class and many other non-public classes.
Answer : B ExplainationNo, a java file can contain only one public class.
Answer : A ExplianationByte variable has default value of 0 if defined as an instance/static variable.
Answer : B ExplainationShort variable has default value of 0 if defined as an instance/static variable.
Answer : A ExplainationByte variable has default value of 0 if defined as an instance/static variable.
Answer : B Explainationshort variable has default value of 0 if defined as an instance/static variable.
Answer : A Explainationint variable has default value of 0 if defined as an instance/static variable.
Answer Sheet Question Number Answer Key 1 C 2 B 3 A 4 A 5 B 6 B 7 B 8 D 9 C 10 A 11 B 12 C 13 D 14 C 15 D 16 B 17 B 18 A 19 A 20 B 21 A 22 A 23 A 24 B 25 Ajava_questions_answers.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4