Today's CS Questions...
(Not a Challenge)
Q) "An array variable can carry only one type of value": Justify your answer.
Q) Explain "subscript out of bounce" error? What type of error it is?
_
• Donnot Spam!
Answers
Answered by
0
Answer:
An array is a collection of elements of the same type placed in contiguous memory locations that can be individually referenced by using an index to a unique identifier. Five values of type int can be declared as an array without having to declare five different variables (each with its own identifier)
Answered by
11
Answer:
1.An array is defined as a linear data structure which contains homogenous data at contiguous memory locations.These are used when we need to store bulk data of similar type.Or else,we need to use many variables which makes it cumbersome.Example:- Roll of 50 students.
2.This is a run-time error.It happens when we cross the limit of array and keep adding elements further.In Java,this is called OutOfBoundException.
Similar questions