About 466,000 results
Open links in new tab
  1. Java Program to Implement Shape Interface using Circle and Rectangle

    This is a Java Program to Make Shape as an Interface and Implement it using Circle and Rectangle Class. Interfaces are syntactically similar to classes, but they lack instance …

  2. Java Polymorphism - Shape Class with Circle, Rectangle

    May 16, 2025 · Write a Java program to create a base class Shape with a method called calculateArea (). Create three subclasses: Circle, Rectangle, and Triangle. Override the …

  3. Write a java program that prints a circle, rectangle or triangle ...

    Mar 1, 2022 · The user should enter a string("circle","rectangle" or "triangle") and that should be used to determine the shape to output. You then need to use .equals to compare the entered …

  4. Java Program to Create Different Shapes using Applet

    Nov 15, 2023 · In this article, we will fill the random attractive colors in shapes like rectangles, circles, and squares using Applet. Here, we will have three buttons rectangle, circle, and …

  5. Shape Interface Implementation: Java Exercise - Interview Sansar

    Aug 18, 2024 · EXERCISE: Create a Shape interface having methods area () and perimeter (). Create 2 subclasses, Circle and Rectangle that implement the Shape interface. Create a class …

  6. Java - Create abstract class Shape, concrete Rectangle Class and Circle

    public Rectangle (double width, double height) { // Set the shape name as "Rectangle" super ("Rectangle"); this.width = width; this.height = height; // Provide an implementation for inherited …

  7. java - Implementing a Shapes application using the following …

    Nov 8, 2013 · Create classes Circle and Rectangle which implement the Shape interface. These classes have attributes which reflect their dimensions (radius for a circle, height and width for …

  8. Java - Shape with the getArea() method - w3resource

    Apr 28, 2025 · Write a Java program to extend the Shape interface by adding a getPerimeter () method and implement it in Rectangle, Circle, and Triangle classes. Write a Java program to …

  9. Problem-Solving-Solutions/Java/Interface/1. Write a Java program

    Write a Java program to create an interface Shape with the getArea () method. Create three classes Rectangle, Circle, and Triangle that implement the Shape interface. Implement the …

  10. Java AWT - Drawing rectangle, line and circle - Mkyong.com

    Feb 1, 2014 · This article discusses the code to draw simple shapes like Rectangle, Line, Circle, etc. JFrame and JPanel are classes belonging to javax.swing libraries. Swing library is created …

Refresh