About 1,610,000 results
Open links in new tab
  1. Java program to find area of rectangle triangle Interface

    Write a Java program to define an interface called Area which contains a method called Compute () and calculate areas of the rectangle (I*b) and triangle (1/2*b*h) using classes Rectangle and …

  2. Java - Calculate the area and perimeter of shapes - w3resource

    May 17, 2025 · The class provides implementations of the abstract methods "getArea ()" and "getPerimeter ()" to calculate the area and perimeter of the triangle based on its three sides …

  3. 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 …

  4. java - Calculate area of square, triangle and circle using both ...

    Mar 31, 2022 · A better way could be: make Shape abstract, and have an abstract method protected double computeArea() ... and a (non-abstract) method printArea () ... that calls the …

  5. Java program with interface Area to Compute the area of rectangle

    Java program with interface Area to Compute the area of rectangle and triangle by Mahesh Huddar In this video, I will discuss how to write a Java program to define an interface called …

  6. Calculate the area of triangle and rectangle by using abstract class ...

    Sep 25, 2018 · { abstract void cal (float a1 , float b1); void display () { System.out.println ("The Calculated Area for the Triangle and Rectangle : "); } } class Triangle extends Area { double a; …

  7. Java Program to Find the Area of a Triangle - GeeksforGeeks

    Aug 5, 2024 · In this article, we will learn how to find the area of the triangle. There can be two possibilities while calculating the area of the triangle as per cases. Case 1: When the height …

  8. Java Program to Calculate Area of Square, Rectangle and Triangle

    In this guide, we will create separate Java programs to calculate the area of a square, rectangle, and triangle. Each program will prompt the user to enter the necessary dimensions for the …

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

    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.

  10. Find the area of triangle and rectangle in java

    How do you find the area of a triangle in Java? To find the area of a triangle, we have to know the formula to find the area of a triangle and that is Area = ( b * h ) / 2, Where b is the base and h …

Refresh