About 460,000 results
Open links in new tab
  1. Creating a number rectangle in Java using a nested for loop with …

    Sep 22, 2022 · I'm new to Java and have an assignment that requires me to create a rectangle of numbers where the numbers start from the 'user input' number and reduce to 1 in the middle …

  2. java - User input values for a Rectangle - Stack Overflow

    Sep 18, 2021 · If you wish to create the rectangle in the initializeRectangle method, the read values need to be passed to it. This could be done by e.g. returning the values in an object. As …

  3. Printing a Rectangle in Java with limits and IF statement that …

    Nov 24, 2015 · I am trying to create a program that takes user input and makes a rectangle. The user input to numbers for length and width and another symbol or character to fill in the …

  4. java - How to create an array of Rectangles with a Rectangle

    Apr 3, 2013 · Create an array of rectangles and add a rectangle to each index. Rectangle[] arr = new Rectangle[10]; for(int i = 0; i < 10; i++) { Rectangle r = new Rectangle(); …

  5. java - Rectangle packing in smallest possible area - Code …

    Jan 1, 2019 · I have written a Java Program to place a bunch of rectangles into the smallest possible rectangluar area (no overlapping and rotating). Here is a short summary: I calculate …

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

    Sep 7, 2021 · Java program to create a Rectangle class that can calculate the area and perimeter using different methods.

  7. Creating a Simple Java Application using the Rectangle class: …

    Creating a Simple Java Application using the Rectangle class: Step 01. Analyze the Problem. We will develop a Java application for programming problem P2.1 found in Chapter 2, End-of …

  8. java - Two methods to prompt the user to enter the width and …

    Oct 13, 2017 · Prompt the user for the width of the rectangle until they enter a number greater than zero; Set the rectangleWidth to the number; Prompt the user for the length of the …

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

  10. AreaRectangle.java - GitHub

    /** You must complete this program so it calculates and displays the area of a rectangle. */ import java.util.Scanner; public class AreaRectangle { public static void main (String [] args) { // …

Refresh