Search Header Logo

Strings & Arrays

Authored by Abdul Rahman

English

University

Used 2+ times

Strings & Arrays
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int a[]={1,2,3};

int b[]=a;

a[0]+=1;

a[1]+=1;

System.out.println(b[0]+b[1]+b[2]);

8

6

123

233

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String a='mango';

String b='MANGO';

System.out.println(a.equals(b));

error

true

false

nothinng will be printed

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String a="mango";

String b="MANGO";

System.out.println(a==b);

true

false

error

Nothing will be printed

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String a=new String("APPLE");

String b=new String("APPLE");

System.out.println(a==b);

true

false

error

Nothing will be printed

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int a[]=new int[3];

a[0]=1;

a[1]=2;

System.out.println(a[0]+a[1]+a[2]);

3

123

out of bound error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

System.out.println(1+2+""+3+4);

334

1234

10

37

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String a="12";

for(int i=0;i<a.length();i++){

a+='1';

}

System.out.println(a);

121

12

infinite loop

31

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?