
arrays
Authored by PUSHPALATHA C2114
Computers
University
Used 1+ times

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
1. Which of these operators is used to allocate memory to array variable in Java?
a) malloc
b) alloc
c) new
d) new malloc
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2. Which of these is an incorrect array declaration?
a) int arr[] = new int[5]
b) int [] arr = new int[5]
c) int arr[] = new int[5]
d) int arr[] = int [5] new
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
3. Which of these is necessary to specify at time of array initialization?
a) Row
b) Column
c) Both Row and Column
d) None of the mentioned
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
4. Which of these is an incorrect Statement?
a) It is necessary to use new operator to initialize an array
b) Array can be initialized using comma separated expressions surrounded by curly braces
c) Array can be initialized when they are declared
d) None of the mentioned
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
5.What will be the output of the following Java code?
class array_output
{
public static void main(String args[])
{
int array_variable [] = new int[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = i;
System.out.print(array_variable[i] + " ");
i++;
}
}
}
a) 0 2 4 6 8
b) 1 3 5 7 9
c) 0 1 2 3 4 5 6 7 8 9
d) 1 2 3 4 5 6 7 8 9 10
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
6.What is the index range for the elements of an array in Java?
a) 0 to length - 1
b) 1 to length
c) -1 to length - 1
d) 0 to length
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
7.What happens if you try to access an array element with an index that is out of bounds?
a) A runtime exception is thrown
b) The program terminates abruptly
c) The element value is set to null
d) The element value is set to 0
Access all questions and much more by creating a free account
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
15 questions
07 - Map
Quiz
•
University
10 questions
Python quick quiz
Quiz
•
University
10 questions
Seatwork HASH (Data Structure)
Quiz
•
University
10 questions
pointers and structures
Quiz
•
University
15 questions
Web Dev Midterm Quiz
Quiz
•
University
8 questions
Cha-ching 2
Quiz
•
1st Grade - University
10 questions
Kiểm tra học kỳ 1 lớp 2
Quiz
•
2nd Grade - University
10 questions
Teste python- Unesp-Jaboticabal
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade