是否可以将数组声明为实例变量?
public class Dog
{
public static void main(String[] args)
{
Some code like creating objects
}
}
class Dogtesr
{
int[] nums;
nums = new int[5]; // This shows an error
}
是否可以将数组声明为实例变量?
public class Dog
{
public static void main(String[] args)
{
Some code like creating objects
}
}
class Dogtesr
{
int[] nums;
nums = new int[5]; // This shows an error
}