Can we specify the size at the time of array declaration?
class Array1
{
public static void main(String[] args)
{
int[6] x;
System.out.println("hello");
}
}
/*
Output:- Compilation error
Explanation:- At the time of array declaration we cannot specify the size of array
otherwise we will get compile time error.
*/
{
public static void main(String[] args)
{
int[6] x;
System.out.println("hello");
}
}
/*
Output:- Compilation error
Explanation:- At the time of array declaration we cannot specify the size of array
otherwise we will get compile time error.
*/
0 comments: