/******************************************************************************
Online Java Compiler.
Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
import java.util.Scanner;
class Student {
public String name;
private int age;
public int getAge() {
return this.age;
}
public void setAge(int age) {
if (age < 0) {
this.age = 0;
System.out.println("Invalid age");
return;
}
this.age = age;
}
}
class Main {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
String name = read.nextLine();
int age = read.nextInt();
Student student = new Student();
student.name = name;
student.setAge(age);
System.out.println("Name: " + student.name);
System.out.println("Age: " + student.getAge());
}
}