Instead of a single parameter, I tried passing arrays as parameter and this happens. Where am I going wrong? I am a beginner, Btw!
public class ClassArrayTest
{
public static void main(String[] args)
{
fruit f = new fruit({"peach","apple","mango"});
f.display();
}
}
class fruit
{
String[] a;
public fruit(String[] aa)
{
a = aa;
}
void display()
{
System.out.println(a);
}
}