A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/java/java_mock_test.htm below:

Java Mock Test

Java Mock Test

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 Explaination

Correct syntax is public static void main(String[] args).

Answer : B Explaination

Boolean is a class and is not a keyword.

Answer : A Explaination

A 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 Explaination

Primitive variables like int, float are stored on Stack.

Answer : B Explaination

Objects are allocated memory in heap memory space.

Answer : A Explaination

True, Static functions can be accessed via class name or via null reference.

Answer : B Explaination

True, Compile time error will occur if an int variable is compared with Boolean variable.

Answer : D Explaination

Local variables are not assigned any value by default.

Answer : C Explaination

Instance 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 Explaination

The byte data type is represented by an 8-bit signed two's complement integer.

Minimum value: -128

Maximum value: 127

Answer : B Explaination

The short data type is represented by 16-bit signed two's complement integer.

Minimum value: -32,768

Maximum value: 32,767

Answer : C Explaination

The int data type is represented by 32-bit signed two's complement integer,

Minimum value: -231

Maximum value: 231-1

Answer : D Explaination

The long data type is represented by 64-bit two's complement integer.

Minimum value: -263

Maximum value: 263-1

Answer : C Explaination

The float data type is represented by single-precision 32-bit IEEE 754 floating point.

Answer : D Explaination

The double data type is represented by double-precision 64-bit IEEE 754 floating point.

Answer : B Explaination

The char data type is represented by single 16-bit Unicode character.

Minimum value: '\u0000' (or 0)

Maximum value: '\uffff' (or 65,535)

Answer : B Explaination

The boolean data type can take either true or false, but its "size" isn't precisely defined.

Answer : A Explaination

True, an empty .java file is a valid source file.

Answer : A Explaination

True, a java file can contain one public class and many other non-public classes.

Answer : B Explaination

No, a java file can contain only one public class.

Answer : A Explianation

Byte variable has default value of 0 if defined as an instance/static variable.

Answer : B Explaination

Short variable has default value of 0 if defined as an instance/static variable.

Answer : A Explaination

Byte variable has default value of 0 if defined as an instance/static variable.

Answer : B Explaination

short variable has default value of 0 if defined as an instance/static variable.

Answer : A Explaination

int 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 A

java_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