+ 1
Pls tell me why the code below is not working
public class Program { public static void main(String[] args) { int Arr[5]; System.out.println(Arr.length); } }
3 Respuestas
+ 16
That's not the way to declare an array in Java. That's the c++ way I guess.
This would help :
int arr[] = new int[5];
+ 3
array declaration is wrong
int arr []=new int [5]
+ 2
you need to define the array's capacity, or the number of elements it will hold.