JAVA - Day2

JAVA - Day2

University

15 Qs

quiz-placeholder

Similar activities

Java_Quiz_Part_2

Java_Quiz_Part_2

University

12 Qs

Java_MCQ_3

Java_MCQ_3

University

15 Qs

Programación Avanzada 2025A

Programación Avanzada 2025A

University

20 Qs

quiz1B1

quiz1B1

7th Grade - University

20 Qs

PPL (QUIZ 6) Memory Management Quiz

PPL (QUIZ 6) Memory Management Quiz

University

20 Qs

Tes Awal Modul 1_PK

Tes Awal Modul 1_PK

University

20 Qs

java2/67

java2/67

12th Grade - University

10 Qs

Module 5: Creating Dynamic Web Pages with Scripting

Module 5: Creating Dynamic Web Pages with Scripting

University

15 Qs

JAVA - Day2

JAVA - Day2

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Chitra Muthu

Used 1+ times

FREE Resource

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

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?

Discover more resources for Information Technology (IT)