JAVA String-1.1

JAVA String-1.1

10th Grade

20 Qs

quiz-placeholder

Similar activities

Measuring Tools - Construction

Measuring Tools - Construction

8th - 12th Grade

20 Qs

unit 7 programming quiz

unit 7 programming quiz

9th - 12th Grade

15 Qs

permrograman terstruktur

permrograman terstruktur

10th Grade

20 Qs

Semiotics - icon, index or symbol sign?

Semiotics - icon, index or symbol sign?

10th Grade - University

15 Qs

PHP Pretest

PHP Pretest

10th Grade

15 Qs

Latihan Bahasa Pemrograman C ++

Latihan Bahasa Pemrograman C ++

10th Grade

20 Qs

[Eng Apps] Sem 2 Midterm Review

[Eng Apps] Sem 2 Midterm Review

10th Grade

18 Qs

Nutrition

Nutrition

9th - 12th Grade

20 Qs

JAVA String-1.1

JAVA String-1.1

Assessment

Quiz

Other

10th Grade

Medium

Created by

Nishat Khimani

Used 378+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is String a primitive data type?

Yes

No

Both

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method to use to find length of a string?

length()

size()

long()

count()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which data type gets returned from length() method in String class?

double

String

int

number

4.

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);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is correct method to convert String into uppercase

changeUpperCase()

convertUpperCase()

toUpper()

toUpperCase()

6.

MULTIPLE CHOICE QUESTION

30 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

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?