RectMaker

RectMaker - Rectangle rec4 rec4 = new Rectangle(rec2 int...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
public class RectMaker { p public static void main (String[] args) { p System.out.println("About to make rectangles"); Rectangle rec1; rec1 = new Rectangle(); // default constructor Rectangle rec2; rec2 = new Rectangle(8.0, 3.5);// constructor Rectangle rec3; rec3 = new Rectangle(4.5, 67.8);// constructor
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Rectangle rec4; rec4 = new Rectangle(rec2); int val = 12; i System.out.println(rec1.getLength()); System.out.println(rec2.getLength()); System.out.println(rec3.getLength()); System.out.println(rec4.getLength()+", "+rec4.getWidth()); S } }...
View Full Document

This note was uploaded on 11/30/2009 for the course COMP 110 taught by Professor Stotts during the Spring '08 term at UNC.

Ask a homework question - tutors are online