JAVA - Day2

JAVA - Day2

University

15 Qs

quiz-placeholder

Similar activities

DSA (QUIZ 3) - Recursion

DSA (QUIZ 3) - Recursion

University

15 Qs

Tổng kết CLB Minecraft Education

Tổng kết CLB Minecraft Education

1st Grade - University

20 Qs

KUIS KODING & KA 1

KUIS KODING & KA 1

10th Grade - University

10 Qs

NoSQL Concepts

NoSQL Concepts

University

10 Qs

Quiz 3 OOPL

Quiz 3 OOPL

University

19 Qs

Understanding Loops in C Programming

Understanding Loops in C Programming

1st Grade - University

15 Qs

PRETEST 8 (ANN)

PRETEST 8 (ANN)

University

10 Qs

ИнфоShow

ИнфоShow

University

13 Qs

JAVA - Day2

JAVA - Day2

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Hard

Created by

Chitra Muthu

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is immutable in Java?

String

StringBuffer

StringBuilder

Both B and C

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following code?
String s1 = "Hello";

String s2 = "Hello";

System.out.println(s1 == s2);

true

false

Compilation error

Runtime error

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is used to create a mutable string in Java?

String

StringBuffer

StringBuilder

Both B and C

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which method is used to get the length of a string?

size()

length()

getSize()

getLength()

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is thread-safe?

String

StringBuffer

StringBuilder

Both A and B

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following code?
String s = "Java";

s.concat("Programming");

System.out.println(s);

JavaProgramming

Java

Compilation Error

Runtime Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following class provides fast and efficient string modification?

String

StringBuffer

StringBuilder

Both B and C

Access all questions and much more by creating a free account

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

Already have an account?