JAVA - Day2

JAVA - Day2

University

15 Qs

quiz-placeholder

Similar activities

Assembly Language and MIPS Architecture Quiz

Assembly Language and MIPS Architecture Quiz

University

15 Qs

Java_Quiz_Part_2

Java_Quiz_Part_2

University

12 Qs

Programación Avanzada 2025A

Programación Avanzada 2025A

University

20 Qs

Codean - Java Rekursi

Codean - Java Rekursi

University

18 Qs

Java Basics Quiz for CH/PT Students

Java Basics Quiz for CH/PT Students

University

16 Qs

Quiz sobre el ornitorrinco y la programación

Quiz sobre el ornitorrinco y la programación

8th Grade - University

15 Qs

Типы данных. Переменные. Операции в Java

Типы данных. Переменные. Операции в Java

University

10 Qs

Java Exception Handling Quiz

Java Exception Handling Quiz

University

20 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?