BCSC0006 - Quiz 1 - Arrays
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Divyansh Bhardwaj
Used 57+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the possible output of the following code?
String[] strings = new String[2];
System.out.println(strings);
[null, null]
[ , ]
String@74a14482
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many lines does the following code output?
String[] days = new String[] { “sun”, ”mon”, ”tue”, ”wed”, ”thr”, ”fri”, ”sat”, ”sun”} ;
for(int i =1;i<=days.length ;i++)
System.out.println (days[i]);
six
seven
The code does not compile
The code compiles but throws an exception at runtime
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many dimensions does the array reference moreBools allow?
boolean[][] bools[], moreBools;
one dimension
two dimensions
three dimensions
none of the above
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If an index value is less than 0 or greater than or equal to 'array name'.length in an array element access expression, an . . . . . . is thrown.
ArrayOutOfBoundsException
ArraysIndexOutOfBoundsException
ArrayIndexOutOfBoundsException
ArrayIndexIsOutOfBoundsException
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To declare a one-dimensional array, you will use this general form
type[] array-name = new [size];
type[size] array-name = new type[];
type[] array-name = new type[size];
type[] array-name = type[size];
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these array declaration statements are not legal?
int[ ][ ] i = { { 1, 2 }, { 1 }, {}, { 1, 2, 3 } };
int[ ] x = new int[2] {1, 2};
int[ ][ ] x = new int[ ][ ] { {1, 2, 3}, {4, 5, 6} };
int[ ][ ] x = { { 1, 2 }, new int[ 2 ] };
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these operators is used to allocate memory to array variables in Java?
malloc
alloc
new
new malloc
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
TIU Quiz-4
Quiz
•
University
15 questions
Fundamentals of Algorithms - Unit 1 - Test 1
Quiz
•
University
10 questions
Dart
Quiz
•
University
10 questions
LEFT_RIGHT_MID Excel Functions Quiz
Quiz
•
9th Grade - University
15 questions
Quiz 1
Quiz
•
University
11 questions
Java Quizz 2
Quiz
•
University
10 questions
Analysis of Algorithms
Quiz
•
University
10 questions
python quiz
Quiz
•
6th Grade - Professio...
Popular Resources on Wayground
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
15 questions
Solving Equations with Variables on Both Sides Review
Quiz
•
8th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
7 questions
Transition Words and Phrases
Interactive video
•
4th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
34 questions
Unit 5 Review - The Middle Ages in Europe-B
Quiz
•
9th Grade - University
26 questions
Day2 classwork: Permutation and combination
Quiz
•
2nd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
