Search Header Logo

String_bca

Authored by Kirti Aggarwal

Computers

University

Used 6+ times

String_bca
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

45 sec • 1 pt

public static void main(String[] args) {

String s="Good Morning";

System.out.println(s.substring(2,6));

}

oodMo

ood M

odMor

od M

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s="GoodMorning";

System.out.println(s.charAt(11));

}

g

null

java.lang.StringIndexOutOfBoundsException

n

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s="Good";

String st="Hello";

System.out.println(s==st);

}

true

false

1

-1

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s="Good";

String st=s;

System.out.println(s==st);

}

true

false

1

-1

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s="GoodMorning";

System.out.println(s.startsWith('G'));

}

true

false

null

java.lang.Error: Unresolved compilation problem:

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s="GoodMorning";

System.out.println(s.indexOf('m'));

}

false

-1

null

4

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

public static void main(String[] args){

String s1="10";

String s2="100";

System.out.println(s1+s2);

}

110

10100

compile time error

10010

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