Java 1

Java 1

University

22 Qs

quiz-placeholder

Similar activities

 Milking Minds 17-01-24

Milking Minds 17-01-24

University

25 Qs

Java Como Programar - Deitel - Cap 1 e 2

Java Como Programar - Deitel - Cap 1 e 2

University

18 Qs

Coding Titans

Coding Titans

University

17 Qs

Java Programming Quiz 1

Java Programming Quiz 1

University

18 Qs

TechZoom24-BugBash_Prelims

TechZoom24-BugBash_Prelims

University

25 Qs

Java Methods

Java Methods

9th Grade - University

23 Qs

PEMROGRAMAN WEB

PEMROGRAMAN WEB

University

20 Qs

Java Quiz

Java Quiz

University

25 Qs

Java 1

Java 1

Assessment

Quiz

Computers

University

Hard

Created by

Det Det

FREE Resource

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two main types of data types in Java?
Primitive and Composite
Primitive and Reference
Integer and Floating-point
Static and Dynamic

Answer explanation

Java has primitive data types (e.g., int, boolean) and reference data types (e.g., objects, arrays).

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a primitive data type in Java?
int
float
String
boolean

Answer explanation

String is a reference type, not a primitive.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value of a reference variable in Java?
0
null
"" (empty string)
Undefined

Answer explanation

Reference variables default to null, meaning they do not reference an object until initialized.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of an int in Java?
8 bits
16 bits
32 bits
64 bits

Answer explanation

Java int is always 32-bit signed.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will System.out.println(10 / 4); print?
2
2.5
3
2

Answer explanation

Integer division truncates the decimal, so 10 / 4 results in 2.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will System.out.println((5 > 3) ? "Yes" : "No"); print?
Yes
No
true
false

Answer explanation

Since 5 > 3 is true, the ternary operator returns 'Yes'.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will System.out.println(2 + "3"); print?
5
23
6
Compilation error

Answer explanation

2 is converted to a string, so '2' + '3' results in '23'.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?