Hi, I have some questions i am not sure and would like to seek some advice.
Is there any way i can call a method of a class without instantiating an object instance from the class?
Can this be done using abstract class?
public class CatCollection
{
public CatCollection()
{
.........
}
public void addCat(Cat aCat)
{
//adds a Cat object to an array in CatCollection
}
}
public class MainClass
{
public static void main(String[] args)
{
Cat kitty = new Cat(.......);
CatCollection.addCat(kitty); --> how do i enable this to work?
}
}
Thanks.