<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
public class Lab5 {
   public static void main(String args[]) {
      Robot robot = new Robot();
      SmartRobot smartRobot = new SmartRobot();
      
      // robot.doSomething()
      //
      // smartRobot.doSomething();
      // smartRobot.doSomethingElse();
      
      // smartRobot.printNum
      
      // robot.incrementNumber();
      // System.out.println(robot.number);
      // System.out.println(smartRobot.number);
      
      // smartRobot.incrementNumber();
      // System.out.println(robot.number);
      // System.out.println(smartRobot.number);
   }
}

class Robot {
   public int number = 0;
   
   public void doSomething() {
      System.out.println("Robot");
   }
   
   public void doSomethingElse() {
      doSomething();
   }
   
   public void incrementNumber() {
      number++;
   }
   
   public void printNum() {
      System.out.println(number);
   }
}

class SmartRobot extends Robot {
   public int number = 5;
   
   public void doSomething() {
      System.out.println("SmartRobot");
   }
   
   public void printNum() {
      System.out.println(number);
   }
}
</pre></body></html>