If we don't specify the size while creating array then what will happen?
class Array2
{
public static void main(String[] args)
{
int[] x=new int[];
System.out.println(x);
}
}
/*
Output:- CE[array dimension missing]
Explanation:- At the time of array creation compulsary we should specify the size
otherwise we will get compilation error.
*/
{
public static void main(String[] args)
{
int[] x=new int[];
System.out.println(x);
}
}
/*
Output:- CE[array dimension missing]
Explanation:- At the time of array creation compulsary we should specify the size
otherwise we will get compilation error.
*/
0 comments: