0

int [] a, b[],c ; int [] a , b,[]c ; a)both is right? b) both are invalid?? c) only 1st is correct d) only 2nd is correct

25th Sep 2017, 6:24 PM
Ankit Singh Rawat
Ankit Singh Rawat - avatar
2 Respostas
+ 5
I think ans. c) since java define var like forEach order um gonna try da 2nd one But why my internet is bad like this?
25th Sep 2017, 6:31 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
int[] a; valid int []a; valid int [] a; valid int a[]; valid int a []; valid int[] a, b[]; not valid if you're expecting b to be a single dim array, but will complie int[] a, []b; not vaild with the last two you're are attempting to declare a second type in the same line without first ending the statement with a semicolon. I.E. a 2 dimensional array. Java doesn't care if the square brackets come before or after the variable name or the white space.
25th Sep 2017, 6:48 PM
ChaoticDawg
ChaoticDawg - avatar