HiT - Quiz 2

HiT - Quiz 2

Professional Development

26 Qs

quiz-placeholder

Similar activities

UJIAN MID SEMESTER 1 X RPL  PEMROGRAMMAN DASAR

UJIAN MID SEMESTER 1 X RPL PEMROGRAMMAN DASAR

Professional Development

25 Qs

Unit4_Servlets_Exam1

Unit4_Servlets_Exam1

Professional Development

24 Qs

C-1 CHAPTER-3

C-1 CHAPTER-3

Professional Development

21 Qs

Unix

Unix

University - Professional Development

21 Qs

QUIZZ X

QUIZZ X

Professional Development

22 Qs

Web Tech GAME 1

Web Tech GAME 1

Professional Development

21 Qs

3TH sem GAT 2023

3TH sem GAT 2023

Professional Development

22 Qs

HiT - Quiz 2

HiT - Quiz 2

Assessment

Quiz

Computers

Professional Development

Practice Problem

Medium

Created by

Venkatesh iGen

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

int len = "jump it!".length();


What is the value of len?

8

7

9

6

This code does not compile.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

String s = "whatever".substring(1,4);


What is the value of s?

"hate"

"hat"

"whate"

"what"

StringIndexOutOfBoundsException

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

int p = "Go Paw Patrol!".indexOf("p");


What is the value of p?

0

4

3

-1

This code will not compile.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

String s = "cool cat".substring(6);


What is the value of s?

"cat"

"at"

"cool c"

This code does not compile.

StringIndexOutOfBoundsException

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = "Mary".compareTo("Molly");

if (x>=0) System.out.print("Yes");

else System.out.print("No");


What is the output?

Yes

No

There is no output.

This code will not compile.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String s1 = "goat";

String s2 = s1.substring(0,s1.length());

boolean z = s1.equals(s2);


What is the value of z?

true

false

This code will not compile.

StringIndexOutOfBoundsException

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image

Which code segment should go in the blank so that count is equal to the number of times "whoa" occurs in str?

str.length() -2

str.length() -4

str.length() - 3

str.length() - 1

str.length()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?