Search Header Logo

Java Strings

Authored by Shravya R

Computers

University

Used 5+ times

Java Strings
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following snippet?

Hello Java

Java Hello

Hello

String cannot be modified.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is not a method of String class?

charAt()

getChars()

getString()

toCharArray()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Strings in Java can be created using:

String

StringBuffer

StringBuilder

All of these

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To which package does the string class belong to?

java.io

java.util

java.lang

javax.conn

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given this snippet , char chars[] = { 'a', 'b', 'c', 'd', 'e', 'f' };

String s = new String(chars, 2, 3);

What is the value of s?

abc

cde

bc

def

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

byte ascii[] = {65, 66, 67};

String s1 = new String(ascii);

What is the value of s1?

656657

67

ABC

abc

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

toString() belongs to ------- class?

String

Scanner

Object

Main

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?

Discover more resources for Computers