Java String class methods
Flashcard
•
Computers
•
10th - 12th Grade
•
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
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
22 questions
AP CSP Vocab #4
Flashcard
•
9th - 12th Grade
18 questions
Glass
Flashcard
•
9th - 12th Grade
22 questions
Review JavaScript
Flashcard
•
11th Grade - University
15 questions
Physics Final Exam Review
Flashcard
•
10th - 12th Grade
15 questions
Law of Sines
Flashcard
•
10th - 12th Grade
15 questions
Muscle anatomy
Flashcard
•
10th - 12th Grade
15 questions
Triangle Midsegment
Flashcard
•
10th - 12th Grade
15 questions
Email Etiquette & Parts of an Email
Flashcard
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
MINERS Core Values Quiz
Quiz
•
8th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade