import java.util.GregorianCalendar; import java.util.Calendar; class Employee { String name; GregorianCalendar dateOfBirth; public Employee (String name, int year, int month, int day) { this.name = name; this.dateOfBirth = new GregorianCalendar (year, month, day); } } public class App { public static void main(String[] args) { Employee emp = new Employee("Tréner Ferenc", 1982, 5, 27); System.out.println(emp.dateOfBirth.get(Calendar.YEAR)); System.out.println(emp.dateOfBirth.get(Calendar.MONTH)); System.out.println(emp.dateOfBirth.get(Calendar.DATE)); } }