NBKRIST Java Hub

← Back to Exam Panel

Problem Statement: Figure & Circle

Your task is to model a **Circle** using an **Abstract Class** and an **Interface**. This problem is designed to help you understand how to use **interfaces** to define common behavior and how to use **abstract classes** to provide a common base for related objects.

Functional Requirements

Technical Requirements

Follow this class structure for your solution:

Testing Requirements

Your main method must demonstrate the program works by testing the following scenarios:

  1. Individual Circle Test:
    • Create a Circle object with a radius of 5.
    • Print its calculated area (approx. 78.5) and perimeter (approx. 31.4).
  2. Polymorphism Test:
    • Create a List and add the Circle object to it.
    • Write a `for` loop to iterate through the list. Inside the loop, print the area and perimeter of the shape. The output should show the correct values, proving that the correct method is called on the object.