6
I have a Person class and a Date class, the Person class creates a person the date class creates a date to use as the date of birth in the Person class, how do I create a date without having to use the full code in the middle of the person object, the code created so far is this:
public static void main(String[] args) {
Data d = new Data(0, 0, 0);
Pessoa p = new Pessoa("Miguel", "Rua D. Maria", "7400604", objeto_data, "Solteiro");
}
OK that’s just what I was forgetting, so I don’t need to create the reference ?
– Hackdoor145
The command
new
creates the reference and passes directly to the method. This way you do not need to create the variable– Pilati