
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
12 questions
Java History Characteristics Environment
Quiz
•
University
15 questions
8051-MCQ
Quiz
•
University
11 questions
Tutorium 1 - Prog2
Quiz
•
University
15 questions
Fundamentals of Algorithms - Unit 1 - Test 1
Quiz
•
University
10 questions
Teoria General de los Sistemas IF1300
Quiz
•
University
10 questions
Digital Tools
Quiz
•
University
10 questions
LINUX MODULE 03 QUIZ
Quiz
•
University
10 questions
python quiz
Quiz
•
6th Grade - Professio...
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
5 questions
What is Presidents' Day?
Interactive video
•
10th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
20 questions
Mardi Gras History
Quiz
•
6th Grade - University
10 questions
The Roaring 20's Crash Course US History
Interactive video
•
11th Grade - University
17 questions
Review9_TEACHER
Quiz
•
University