Unit 5

Unit 5

University

10 Qs

quiz-placeholder

Similar activities

Java for Geeks and Dummies

Java for Geeks and Dummies

12th Grade - University

10 Qs

Unit 24 - Java Basics

Unit 24 - Java Basics

University

10 Qs

Java Methods

Java Methods

University

15 Qs

PSP Week3

PSP Week3

University

10 Qs

c-languiz

c-languiz

University

10 Qs

JAVA III

JAVA III

University

10 Qs

Basic Java

Basic Java

University

15 Qs

JAVA FINAL QUIZ FOR ASSESSMENT

JAVA FINAL QUIZ FOR ASSESSMENT

University

15 Qs

Unit 5

Unit 5

Assessment

Quiz

Computers

University

Medium

Created by

Mr. V

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. In Java, which class is used to represent a sequence of characters?

  1. CharArray

  1. StringArray

  1. String

  1. CharSequence

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Strings in Java are:

  1. Mutable

  1. Immutable

  1. Both mutable and immutable

  1. None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What happens when you concatenate two strings using the "+" operator in Java?

  1. The original strings are modified

  1. A new string object is created with the concatenated value

  1. The "+" operator cannot be used with strings

  1. An exception is thrown

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which method is used to compare two strings for equality in Java?

  1. compare()

  1. equals()

  1. isEqual()

  1. compareTo()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. What is the result of the following code?

String str1 = "Hello";

String str2 = "hello";

System.out.println(str1.equals(str2));

true

false

The code will not compile

An exception will be thrown

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. The method length() in the String class returns:

  1. The number of characters in the string

  1. The number of words in the string

  1. The size of the string in bytes

  1. The capacity of the string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which method is used to convert all characters in a string to lowercase?

  1. toLowerCase()

  1. convertToLower()

  1. changeCase()

  1. lowerCase()

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?