Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Arrays - Computer Science Engineering (CSE) MCQ

Test: Arrays - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test - Test: Arrays

Test: Arrays for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Arrays questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Arrays MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Arrays below.
Solutions of Test: Arrays questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Arrays solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Arrays | 10 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Arrays - Question 1

Which of these best describes an array?

Detailed Solution for Test: Arrays - Question 1

Array contains elements only of the same type.

Test: Arrays - Question 2

How do you instantiate an array in Java?

Detailed Solution for Test: Arrays - Question 2

Note that int arr[]; is declaration whereas int arr[] = new int[3]; is to instantiate an array.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Arrays - Question 3

What is the output of the following Java code?
public class array
{
    public static void main(String args[])
    {
        int []arr = {1,2,3,4,5};
        System.out.println(arr[2]);
        System.out.println(arr[4]);
    }
}

Detailed Solution for Test: Arrays - Question 3

Array indexing starts from 0.

Test: Arrays - Question 4

When does the ArrayIndexOutOfBoundsException occur?

Detailed Solution for Test: Arrays - Question 4

ArrayIndexOutOfBoundsException is a run-time exception and the compilation is error-free.

Test: Arrays - Question 5

What are the advantages of arrays?

Detailed Solution for Test: Arrays - Question 5

Arrays store elements of the same data type and present in continuous memory locations.

Test: Arrays - Question 6

Assuming int is of 4bytes, what is the size of int arr[15];?

Detailed Solution for Test: Arrays - Question 6

Since there are 15 int elements and each int is of 4bytes, we get 15*4 = 60bytes.

Test: Arrays - Question 7

Elements in an array are accessed _____________

Detailed Solution for Test: Arrays - Question 7

Elements in an array are accessed randomly. In Linked lists, elements are accessed sequentially.

Test: Arrays - Question 8

How do you initialize an array in C?

Detailed Solution for Test: Arrays - Question 8

This is the syntax to initialize an array in C.

Test: Arrays - Question 9

Which of the following is the correct way to declare a multidimensional array in Java?

Detailed Solution for Test: Arrays - Question 9

The syntax to declare multidimensional array in java is either int[][] arr; or int arr[][];

Test: Arrays - Question 10

What is the output of the following Java code?

public class array
{
    public static void main(String args[])
    {
        int []arr = {1,2,3,4,5};
        System.out.println(arr[5]);
    }
}

Detailed Solution for Test: Arrays - Question 10

Trying to access an element beyond the limits of an array gives ArrayIndexOutOfBoundsException.

Information about Test: Arrays Page
In this test you can find the Exam questions for Test: Arrays solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Arrays, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)