Setter & getter in JAVA, please help me to solve this bullshit
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); String name = read.next(); int age = read.nextInt(); Student student = new Student(); student.name = name; student.setAge(age); //set the age via Setter System.out.println("Name: " + student.name); System.out.println("Age: " + student.getAge()); } } class Student { public String name; private int age; public int getAge() { return age; } public void setAge(int newAge) { if (newAge < 0) { System.out.println("Invalid age"); this.age = 0; } else { this.age = age; } } } I cant solve the final code in getter and setter, because the compiler always shows NO OUTPUT. If you have a solution, please sent it