AP Computer Science Unit 2
Quiz
•
Computers
•
Professional Development
•
Hard
Thomas Martinez
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which data type gets returned from length() method in String class?
double
String
int
number
2.
MULTIPLE CHOICE QUESTION
30 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);
3.
MULTIPLE CHOICE QUESTION
30 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)
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following?
String x = "10";
String y = "20";
String z = x + y;
System.out.println(z);
1020
10 20
30
"10 20"
5.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What will be the output of below code?
String statement = "Outfit of the day";
System.out.println(statement.Substring(3,6));
it of
tfit
fit
FIT
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the return type of equals() method?
int
String
char
boolean
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the most appropriate way to check if two Strings are identical?
string1 == string2
string1.equals(string2)
string1.same(string2)
string1.equalsIgnorecase(string2)
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
17 questions
JavaScript 2
Quiz
•
Professional Development
19 questions
Javascript - Revisão
Quiz
•
University - Professi...
20 questions
101-120
Quiz
•
Professional Development
17 questions
Kuiz Umum ICT Sempena Minggu ICT 2023
Quiz
•
Professional Development
20 questions
class 8
Quiz
•
Professional Development
15 questions
Queues
Quiz
•
11th Grade - Professi...
20 questions
Mobile Apps PayKu
Quiz
•
1st Grade - Professio...
15 questions
Fellowship program 2021
Quiz
•
University - Professi...
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
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
21 questions
October 25
Quiz
•
Professional Development
10 questions
October Monthly Quiz
Quiz
•
Professional Development
20 questions
There is There are
Quiz
•
Professional Development
5 questions
SSUSH13
Interactive video
•
Professional Development
10 questions
Halloween Trivia
Quiz
•
Professional Development
