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
Similar Resources on Wayground
13 questions
CSAwesome: 1.2 - Java Basics HW Review

Flashcard
•
11th - 12th Grade
10 questions
Arrays

Flashcard
•
10th - 12th Grade
22 questions
Final Review Part 3

Flashcard
•
11th Grade
11 questions
Java String Objects & Methods

Flashcard
•
12th Grade
22 questions
APCSA Unit 1 Review

Flashcard
•
9th - 12th Grade
15 questions
Unit 7 Test (Basic Data Structures)

Flashcard
•
9th - 12th Grade
19 questions
Array(3)

Flashcard
•
10th Grade
19 questions
Python Lists

Flashcard
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade