JAVA Programming :: Basic Concepts - Discussion
Home > JAVA Programming > Basic Concepts > MCQs Questions Discussion
16 / 64
Given the following constructor what will element 1 of mycon contain?
MyCon(){
int[] mycon= new int[5];
}
MyCon(){
int[] mycon= new int[5];
}
A0
Bnull
C""
DNone of these options
Answer: Option (Login/Signup)
Show Explanation
Hence, mycon[]={0,0,0,0,0}; will be set as default, if nothing is assigned to the array.
Therefore, correct option is A.
Asked In ::
STEP-BY-STEP
Since, mycon is an integer array, the default value for an integer array is 0.
Hence, mycon[]={0,0,0,0,0}; will be set as default, if nothing is assigned to the array.
Therefore, correct option is A.
Read Full Answer
Report Error
Please Login First Click Here