Search Header Logo

String and type wrappers

Authored by RAVINDRA INDURTHI

Computers

9th Grade

Used 1+ times

String and type wrappers
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

String in Java is a?

class

object

variable

character array

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these method of String class can be used to test to strings for equality?

isequal()

isequals()

equal()

equals()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements are incorrect?

String is a class

Strings in java are mutable

Every string is an object of class String

Java defines a peer class of String, called StringBuffer, which allows string to be altered

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

class string_demo

{

public static void main(String args[])

{

String obj = "I" + "like" + "Java";

System.out.println(obj);

}

}

I

like

Java

IlikeJava

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

class output

{

public static void main(String args[])

{

StringBuffer s1 = new StringBuffer("Hello");

StringBuffer s2 = s1.reverse();

System.out.println(s2);

}

}

Hello

olleH

HelloolleH

olleHHello

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

class output

{

public static void main(String args[])

{

StringBuffer c = new StringBuffer("Hello");

c.delete(0,2);

System.out.println(c);

}

}

He

Hel

lo

llo

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these method of class StringBuffer is used to find the length of current character sequence?

length()

Length()

capacity()

Capacity()

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?