Array and Array Operations Multiple Questions and Answers.




6.What is the output of the following piece of code ?
A. 4
B. 5
C. ArrayIndexOutOfBoundsException
D. InvalidInputException

7.When does the ArrayIndexOutOfBoundsException occur?
A. Compile-time
B. Run-time
C. Not an error
D. Not an exception at all

8.Which of the following concepts make extensive use of arrays ?
A. Binary trees
B. Scheduling of processes
C. Caching
D. Spatial locality

9.What are the advantages of arrays ?
A. Objects of mixed data types can be stored
B. Elements in an array cannot be sorted
C. Index of first element of an array is 1
D. Easier to store elements of same data type

10.What are the disadvantages of arrays ?
A. Data structure like queue or stack cannot be implemented
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
C. Index value of an array can be negative
D. Elements are sequentially accessed

«»



Quick Links

GAT Subject



   Computer Science    English    Agriculture    Botany    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC    PPSC    NTS