Java Programming Quiz 1

Java Programming Quiz 1

University

18 Qs

quiz-placeholder

Similar activities

Bootcamp Day 3 - Java Array

Bootcamp Day 3 - Java Array

University

15 Qs

Quiz 1-PBO

Quiz 1-PBO

University

20 Qs

Array of Structure

Array of Structure

University

13 Qs

Diagnóstico Estructuras de Datos-TIID

Diagnóstico Estructuras de Datos-TIID

University

20 Qs

Java Control and Loop -2

Java Control and Loop -2

University

20 Qs

PBO Inheritance Episode 2

PBO Inheritance Episode 2

University

18 Qs

JAVA - Arrays

JAVA - Arrays

University - Professional Development

15 Qs

Java Quiz 3

Java Quiz 3

University

15 Qs

Java Programming Quiz 1

Java Programming Quiz 1

Assessment

Quiz

Computers

University

Hard

Created by

Vijaya Kumar DTT

Used 6+ times

FREE Resource

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a constructor in Java?

To destroy an object

To initialize an object

To define a method

To create a static variable

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to create an instance of a class?

class

new

this

static

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can a class have multiple constructors?

No, only one constructor is allowed

Yes, with different parameter lists

Yes, but only with the same parameters

Only if the class is static

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why are Strings immutable in Java?

To improve performance

To ensure security and thread safety

To allow modification of String objects

To reduce memory usage

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? String s1 = "Hello"; String s2 = "Hello"; System.out.println(s1 == s2);

false

true

Compilation error

Runtime error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class is thread-safe for String manipulation?

String

StringBuilder

StringBuffer

None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the this keyword refer to in Java?

The class itself

The current object

A static method

The parent class

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?