java abstract classes
The program you are given receives name and age of student as input. Complete the program to set the values for the corresponding attributes of the Student class and prints out the final result. If the age is <0, program should output "Invalid age" and assign a 0 value to the age attribute. Sample Input Olivia -2 Sample Output Invalid age Name: Olivia Age: 0 Explanation -2 is invalid value for age attribute, that's why "Invalid age" and "Age: 0" is printed. Setter and Getter should handle this. You need to handle the conditions inside the Getter and the Setter. class Main { public static void main(String[] args) { //do not touch this code Monopoly monopoly = new Monopoly(); Chess chess = new Chess(); Battleships battleships = new Battleships(); monopoly.play(); chess.play(); battleships.play(); } } abstract class Game { abstract String getName(); abstract void play(); public String name; } class Monopoly extends Game { //give "Monopoly" name to game String getName() { return name = "Monopoly"; } // play method should print "Buy all property." void play() { System.out.println("Buy all property."); } } class Chess extends Game { //give "Chess" name to game String getName() { return name = "Chess"; } // play method should print "Kill the enemy king" void play() { System.out.println("Kill the enemy king"); } } class Battleships extends Game { //give "Battleships" name to game String getName() { return name = "Battleships"; } // play method should print "Sink all ships" void play() { System.out.println("Sink all ships"); } }