Quiz 2

Quiz 2

University

10 Qs

quiz-placeholder

Similar activities

Search & Sorting

Search & Sorting

University

11 Qs

Java arrays

Java arrays

University

7 Qs

SLG IPC Week 7

SLG IPC Week 7

University

13 Qs

OOP - Quiz

OOP - Quiz

University

15 Qs

Array Java

Array Java

University

15 Qs

Array

Array

University

12 Qs

Java Array Basics

Java Array Basics

University

15 Qs

cs1300-F17-Week8

cs1300-F17-Week8

12th Grade - University

15 Qs

Quiz 2

Quiz 2

Assessment

Quiz

Computers

University

Hard

Created by

Ms. Asst.Prof

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the length of the following array byte[] data= {12, 34, 9, 0, 62, 88 };

1

5

6

12

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code fragment:

int[] arr= {2, 4, 6, 8, 10, 1, 3, 5, 7, 9};

for(int index=0; index<5; index++)

System.out.print(arr[index]+ " ");

2 4 6 8

2 4 6 8 10

2 4 6 8 10 1

2 4 6 8 10 1 3 5 7 9

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int[] arr = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9};

for(int index=0; index<arr.length; index++)

System.out.println(arr[index]+" ");

2 4 6 8

2 4 6 8 10

2 4 6 8 10 1

2 4 6 8 10 1 3 5 7 9

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these method of class String is used to extract a single character from a String object?

CHARTAT()

charat()

chatAt()

CharAt()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these operators can be used to concatenate two or more String objects?

+

+=

&

||

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the output of the following code fragement

int[] egArray = { 2, 4, 6, 8, 10, 1, 3, 5, 7, 9 };

for(int index=0; index<egArray.length; index=index+2)

System.out.print(egArray[index]+ " ");

2 4 6 8 10 1 3 5 7 9

4 8 1 5 9

2 6 10 3 7

2 6 10 3 7 0

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Does a programmer always know long an array will be when the program is being written?

Yes--the program will not compile without the length being declared.

No-- the array object is created when the program is running, and the length might change from run to run.

Yes-- otherwise the program will not run correctly.

No--arrays can grow to whatever length is needed.

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?