├── README.md └── que 4 └── que4.java /README.md: -------------------------------------------------------------------------------- 1 | # Mock-test-2-java-PPT-PW-skills-Fourth-Question 2 | 3 | 👋 Welcome to my Java project! 4 | 5 | ## Overview 6 | This project contains two classes that demonstrate how to draw different shapes. The `Drawable` interface defines a method for drawing a shape. The `Circle` and `Rectangle` classes are concrete classes that implement the `Drawable` interface and provide an implementation for the `draw()` method. 7 | 8 | ## Usage 9 | To use this project, simply clone the repository and run the `Main` class. 10 | 11 | ## Example Output 12 | - Drawing Circle 13 | - Drawing Rectangle 14 | -------------------------------------------------------------------------------- /que 4/que4.java: -------------------------------------------------------------------------------- 1 | interface Drawable { 2 | void draw(); 3 | } 4 | 5 | class Circle implements Drawable { 6 | public void draw() { 7 | System.out.println("Drawing Circle"); 8 | } 9 | } 10 | 11 | class Rectangle implements Drawable { 12 | public void draw() { 13 | System.out.println("Drawing Rectangle"); 14 | } 15 | } 16 | 17 | public class que4 { 18 | public static void main(String[] args) { 19 | Drawable circle = new Circle(); 20 | Drawable rectangle = new Rectangle(); 21 | 22 | circle.draw(); 23 | rectangle.draw(); 24 | } 25 | } --------------------------------------------------------------------------------