You have to create an Address instance, and then pass it to the Person class' constructor.
For example:
Address address = new Address("City name", "Street, house number, etc.");
Person person...
Type: Posts; User: kjaron
You have to create an Address instance, and then pass it to the Person class' constructor.
For example:
Address address = new Address("City name", "Street, house number, etc.");
Person person...
The object itself may change the variable after initialization, but it would undesirable to change the variable from outside.
In the second case, the "a" variable is not static. Just a package-private instance variable. Instance variables cannot be accessed from a static scope.
In the third case, you cannot use static...
Hi,
A few weeks ago I was invited to the ip2location programming contest. I have never participated in something like this, and it looked to be fun, so I joined. Furthermore, I wanted to learn...