الرجوع
تسجيل الدخول

What is the output of this code?

public class Employee {
    private int id;
    private String name;

    public Employee(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public void printDetails() {
        System.out.println("ID: " + id + ", Name: " + name);
    }
}

public class Test {
    public static void main(String[] args) {
        Employee emp = new Employee(101, "Alice");
        emp.printDetails();
    }
}