JAVA string

JAVA string

12th Grade

18 Qs

quiz-placeholder

Similar activities

CS 26_01_24

CS 26_01_24

9th - 12th Grade

20 Qs

Javascript

Javascript

10th - 12th Grade

15 Qs

Ch 3 Java Review-Strings and Math

Ch 3 Java Review-Strings and Math

9th - 12th Grade

21 Qs

String Manipulation (Python)

String Manipulation (Python)

9th - 12th Grade

17 Qs

AP CSA Review Basics

AP CSA Review Basics

9th - 12th Grade

16 Qs

Chapter 6 Exam

Chapter 6 Exam

9th - 12th Grade

20 Qs

JAVA: Level-1

JAVA: Level-1

5th - 12th Grade

15 Qs

AP CSA Review Unit 2

AP CSA Review Unit 2

9th Grade - University

22 Qs

JAVA string

JAVA string

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Quizizz Content

Used 26+ times

FREE Resource

18 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

Which is correct method to convert String into uppercase

changeUpperCase()

convertUpperCase()

toUpper()

toUpperCase()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String word = "A few good men";
What is word.charAt(7) ?
o
g
7
good men

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String word = "A few good men";
What is word.length()?
14
15
13

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method to use to find length of a string?

length()

size()

long()

count()

7.

MULTIPLE CHOICE QUESTION

2 mins • 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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Computers