About 463,000 results
Open links in new tab
  1. java - Constructing Rectangle - Stack Overflow

    import java.awt.Rectangle; public class Rectangle { public static void main (String [] args) { Rectangle box= new Rectangle (5,10,20,30); System.out.println (box); } }

  2. Rectangle (Java Platform SE 8 ) - Oracle

    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's upper-left point (x,y) in the coordinate space, its width, and its height.

  3. Create a Rectangle class in Java and calculate area, perimeter

    Sep 7, 2021 · With this tutorial, you will learn how to create a class in Java and how to access its methods and parameters. We will follow the following steps: Create one Rectangle class. This …

  4. Creating an Object - cs.princeton.edu

    Here's an example using the new operator to create a Rectangle object (Rectangle is a class in the java.awt package). The new operator requires a single operand--a call to a constructor …

  5. Java Class Rectangle Example - Computer Notes

    In this Example, we have declared two classes: Rectangle and RectangleArea. The Rectangle class contains two fields length and breadth of type int that correspond to the length and …

  6. RectangleClass/Exercise09_01.java at main - GitHub

    /** * (The Rectangle class) * * Following the example of the Circle class in Section 9.2, design a class * named Rectangle to represent a rectangle. * * The class contains: * * - Two double …

  7. Java Encapsulation: Rectangle Class with Getter and Setter Methods

    May 16, 2025 · Learn Java encapsulation by creating a Rectangle class with private instance variables for length and width. Discover how to provide public getter and setter methods to …

  8. Introduction to Java Programming and Data Structures, 13E, Y.

    publicclass Rectangle extends GeometricObject { privatedouble width; privatedouble height; public Rectangle () { } public Rectangle (double width, double height) { this.width = width; …

  9. Create a New Java Class Rectangle – Java Program

    Jul 10, 2019 · Define the Rectangle class that will have: A no-arg constructor that will create the default rectangle with width = 1 and height =1. A parameterized constructor that will create a …

  10. Class java.awt.Rectangle - University of Washington

    A rectangle specifies an area in a coordinate space that is defined by the rectangle's top-left point (x, y) in the coordinate space, its width, and its height. A rectangle's width and height are …

  11. Some results have been removed
Refresh