Java Programming Quiz 1

Java Programming Quiz 1

University

18 Qs

quiz-placeholder

Similar activities

JAVA Basics Quiz

JAVA Basics Quiz

University

20 Qs

TECHFEST QUALIFYING ROUND

TECHFEST QUALIFYING ROUND

University

20 Qs

UTS Praktikum SDA KOM B - 2 Ed

UTS Praktikum SDA KOM B - 2 Ed

University

20 Qs

Revision 2 C

Revision 2 C

University

17 Qs

Java - Nivelamento

Java - Nivelamento

University

15 Qs

'C'Programming Basics - Prepared by Feroz Khan A.B

'C'Programming Basics - Prepared by Feroz Khan A.B

University

15 Qs

Revision 2 MCA

Revision 2 MCA

University

13 Qs

Round 4 - Harvest

Round 4 - Harvest

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

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?