This is a doubt that I have been having for a long time, I have been programming for 1 year in Java, but I still do not have the following clear. Suppose I have 2 simple classes
public class Automovil{
String patente;
String modelo;
int capEstanque;
}
And the other one
Public class Menu{
Automovil auto;
}
I know that to instantiate objects, the = new class () is used, but in this case, in the Menu class, if I leave it as such, that variable% co_of% that it can do? Can you save data? or is it useless?