Java String class methods
Flashcard
•
Computers
•
10th - 12th Grade
•
Practice Problem
•
Hard
Wayground 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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Plant Hormones
Flashcard
•
10th - 12th Grade
15 questions
Radians & the Unit Circle REVIEW
Flashcard
•
10th - 12th Grade
15 questions
Dimensional Analysis
Flashcard
•
10th - 12th Grade
15 questions
Unit 6 Practice Flashcard
Flashcard
•
10th - 12th Grade
15 questions
Angle Bisector and Perpendicular Bisectors part CW
Flashcard
•
10th - 12th Grade
20 questions
Nervous system/Senses
Flashcard
•
11th - 12th Grade
17 questions
Torque
Flashcard
•
9th - 12th Grade
15 questions
Bisectors
Flashcard
•
10th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade