Java String class methods

Flashcard
•
Computers
•
10th - 12th Grade
•
Hard
Quizizz Content
FREE Resource
Student preview

24 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Which method would you use to check if two Strings are exactly the same? Options: equals(), equalsIgnoreCase(), toUpperCase(), toLowerCase()
Back
equals()
2.
FLASHCARD QUESTION
Front
Which method is used to find the length of a string?
Back
length()
3.
FLASHCARD QUESTION
Front
Which data type gets returned from length() method in String class?
Back
int
4.
FLASHCARD QUESTION
Front
What is the correct way to find the length of the string "txt"? Options: int len = length(txt); float len = txt.length(); int len = txt.length(); double len = length(txt);
Back
int len = txt.length();
5.
FLASHCARD QUESTION
Front
String x = "10";
String y = "20";
String z = x + y;
System.out.println(z);
Guess the output.
Back
1020
6.
FLASHCARD QUESTION
Front
Which method is used to find the index of a specified character in a string? Options: charIndex(), indexOf(), findIndex(), searchIndex()
Back
indexOf()
7.
FLASHCARD QUESTION
Front
What is the output of the following code?
String str = "Hello";
System.out.println(str.substring(1, 3));
Back
el
Create a free account and access millions of resources
Similar Resources on Wayground
23 questions
Python - Lists, Dictionaries and Loops

Flashcard
•
9th - 12th Grade
20 questions
Int Prog: Lists and Functions

Flashcard
•
9th - 12th Grade
20 questions
Unit 6 Test Review - Arrays

Flashcard
•
9th - 12th Grade
18 questions
AP CSA Unit 1 Review

Flashcard
•
10th - 12th Grade
19 questions
AP CSP Unit 5 Review: Lists, Loops and Traversals

Flashcard
•
9th - 12th Grade
18 questions
Python Lists

Flashcard
•
9th - 12th Grade
20 questions
Python Sem. Review P1

Flashcard
•
11th Grade
13 questions
Python Arrays

Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Hersheys' Travels Quiz (AM)

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
30 questions
Lufkin Road Middle School Student Handbook & Policies Assessment

Quiz
•
7th Grade
20 questions
Multiplication Facts

Quiz
•
3rd Grade
17 questions
MIXED Factoring Review

Quiz
•
KG - University
10 questions
Laws of Exponents

Quiz
•
9th Grade
10 questions
Characterization

Quiz
•
3rd - 7th Grade
10 questions
Multiply Fractions

Quiz
•
6th Grade