
Java String Quiz

Quiz
•
Computers
•
1st Grade - University
•
Medium
M. R.
Used 17+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the type of objects that can store a sequence of characters in Java?
Character
String
Array
Text
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used for both addition and concatenation in Java?
/
-
*
+
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a string using the new keyword in Java?
String str = new String[];
String str = String.new();
String str = new String("");
String str = new String();
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What escape character is used to insert a double quote in a string?
\"
\'
\\
\n
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the result of the following code:
String x = "50";
int y = 20;
String z = x + y;
50.20
50
5020
70
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which escape sequence represents a new line in Java?
\b
\r
\t
\n
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code:
String str = "Hello";
System.out.println(str.length());
5
4
Null
6
Create a free account and access millions of resources
Similar Resources on Wayground
22 questions
Java Code Snippets Quiz 1

Quiz
•
10th Grade
20 questions
The String Class

Quiz
•
12th Grade
15 questions
002_Java Methods

Quiz
•
12th Grade - University
16 questions
Arithmetic Types Declare Initialize Relation Logical Ops

Quiz
•
9th Grade - University
23 questions
Java Array

Quiz
•
University
20 questions
3rd Qtr QUIZ1 COMPUTER PROGRAMMING-Strings in Java-2-22-2023

Quiz
•
12th Grade
17 questions
"switch" Java Statement - 1

Quiz
•
9th - 10th Grade
15 questions
Java Bootcamp Day 4

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade