Java Programming Quiz in String

Java Programming Quiz in String

Professional Development

21 Qs

quiz-placeholder

Similar activities

Java

Java

Professional Development

20 Qs

Python - Quiz

Python - Quiz

Professional Development

20 Qs

TMA 1

TMA 1

Professional Development

20 Qs

PSUEDOCODE 2 CAPGEMINI

PSUEDOCODE 2 CAPGEMINI

Professional Development

25 Qs

PEMOGRAMAN BERORINTASI OBJECK XII_I

PEMOGRAMAN BERORINTASI OBJECK XII_I

Professional Development

20 Qs

VIVANTA 23

VIVANTA 23

Professional Development

20 Qs

ระบบ PLC Panel (Recycle Water System)

ระบบ PLC Panel (Recycle Water System)

Professional Development

20 Qs

WTN-CLASS

WTN-CLASS

Professional Development

20 Qs

Java Programming Quiz in String

Java Programming Quiz in String

Assessment

Quiz

Other

Professional Development

Medium

Created by

Niveditha N

Used 2+ times

FREE Resource

21 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the following code? String s1 = "Java"; String s2 = "Java"; String s3 = new String("Java"); System.out.println(s1 == s2); System.out.println(s1 == s3);

true, true

true, false

false, true

false, false

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be printed? String s = "abc"; s.concat("def"); System.out.println(s);

abc

abcdef

def

Compilation error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct statement:

StringBuilder is synchronized.

StringBuffer is not synchronized.

StringBuilder is faster but not thread-safe.

String is mutable.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Output? StringBuilder sb = new StringBuilder("123"); sb.reverse(); System.out.println(sb);

123

321

Error

1 2 3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this print? String str = "hello"; str.toUpperCase(); System.out.println(str);

HELLO

hello

Error

null

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of these methods is NOT available in StringBuilder?

append()

reverse()

charAt()

trim()

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which creates a new object each time it's modified?

String

StringBuffer

StringBuilder

All of the above

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?