+ 1
How to access name and age in main method...??
import java.util.*; public class Main { } class Person{ class Student{ String name; int age; } }
1 Resposta
+ 5
Best way is to make getters and setters. That are methods which can set the value of a variable of the class. and the getters return the value of the variable of the class.