
Java Programming Quiz in String

Quiz
•
Other
•
Professional Development
•
Medium

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
Similar Resources on Wayground
25 questions
Java Basics

Quiz
•
Professional Development
17 questions
Mastering Arrays in Go

Quiz
•
Professional Development
20 questions
TIME OUT - SHOPPER EXPERIENCE TEAM

Quiz
•
Professional Development
18 questions
Tiếng Anh

Quiz
•
Professional Development
20 questions
Entry test on Recovery and Negotiating skills

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Other
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
14 questions
2019 Logos

Quiz
•
Professional Development
6 questions
GUM Chart Scavenger Hunt

Quiz
•
Professional Development
8 questions
Understanding Government: Limited and Unlimited

Quiz
•
Professional Development
20 questions
tape measure

Quiz
•
Professional Development
24 questions
Street Signs

Quiz
•
9th Grade - Professio...