diff --git a/OOP/Java/Lab/Week6/Game/Gamer.java b/OOP/Java/Lab/Week6/Game/Gamer.java new file mode 100644 index 0000000..7eda681 --- /dev/null +++ b/OOP/Java/Lab/Week6/Game/Gamer.java @@ -0,0 +1,33 @@ +class Game { + + void type() { + System.out.println("Indoor & outdoor games"); + } +} + +class Cricket extends Game { + + void type() { + System.out.println("Cricket is an outdoor game"); + } +} + +class Chess extends Game { + + void type() { + System.out.println("Chess is an indoor game"); + } +} + +class Gamer { + + public static void main(String[] args) { + Game game = new Game(); + Game cricket = new Cricket(); + Game chess = new Chess(); + + game.type(); + cricket.type(); + chess.type(); + } +}