Test

Quiz
•
Computers
•
University
•
Medium
VARDAN VARDAN
Used 3+ times
FREE Resource
35 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Is String a primitive data type?
Yes
No
Both
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which method to use to find length of a string?
length()
size()
long()
count()
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which data type gets returned from length() method in String class?
double
String
int
number
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
What is the correct way to find the length of "txt" string?
int len = length(txt);
float len = txt.length();
int len = txt.length();
double len = length(txt);
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which is correct method to convert String into uppercase
changeUpperCase()
convertUpperCase()
toUpper()
toUpperCase()
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
String txt = "Hello World";
System.out.println(txt.toUpperCase());
Choose the correct output.
"HELLO WORLD"
HELLO WORLD
Hello world
Hello World
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Choose correct purpose of indexOf() in String class.
returns the index (the position) of the last occurrence of a specified text in a string
returns the character of the first occurrence of a specified character in a string
returns the index (the position) of the first occurrence of a specified text in a string (excluding whitespace)
returns the index (the position) of the first occurrence of a specified text in a string (including whitespace)
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
Computer Programming 1 Review

Quiz
•
University
40 questions
Arrays and ArryList

Quiz
•
University
30 questions
AZ62

Quiz
•
University
35 questions
Final Exam - BECC0302

Quiz
•
University
30 questions
Round_1 (B)| Coding Combat 2.0

Quiz
•
University
30 questions
python

Quiz
•
University
34 questions
Java Quiz

Quiz
•
11th Grade - University
40 questions
Java Programming

Quiz
•
University
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

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

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade