
Unit 5

Quiz
•
Computers
•
University
•
Medium
Mr. V
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Java, which class is used to represent a sequence of characters?
CharArray
StringArray
String
CharSequence
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Strings in Java are:
Mutable
Immutable
Both mutable and immutable
None of the above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when you concatenate two strings using the "+" operator in Java?
The original strings are modified
A new string object is created with the concatenated value
The "+" operator cannot be used with strings
An exception is thrown
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to compare two strings for equality in Java?
compare()
equals()
isEqual()
compareTo()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the following code?
String str1 = "Hello";
String str2 = "hello";
System.out.println(str1.equals(str2));
true
false
The code will not compile
An exception will be thrown
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The method length() in the String class returns:
The number of characters in the string
The number of words in the string
The size of the string in bytes
The capacity of the string
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to convert all characters in a string to lowercase?
toLowerCase()
convertToLower()
changeCase()
lowerCase()
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Java Quiz 1

Quiz
•
University
13 questions
Object oriented programming in java

Quiz
•
University
10 questions
Java Strings

Quiz
•
1st Grade - Professio...
10 questions
Talent Next Java MCQ-1

Quiz
•
University
11 questions
Array

Quiz
•
University
15 questions
JavaScript Basics

Quiz
•
12th Grade - University
15 questions
002_Java Methods

Quiz
•
12th Grade - University
11 questions
Basics of JAVA

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade