Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Java - Rectangle + Origo Posted by NeewBieGeKo on 27 Nov 2012 at 10:34 AM
Someone who can help me to write and explain a code to write a class that handles rectangle rectangles with height, width, position and girth. The width and the height is set by the rectangle is created and the position means automatically to the origin x = 0 and y = 0. Using this method can move the rectangle changes.

I have write this code now, as you will see Im an very big noob:

public class Rectangle

{

public int length=0;

public int height=0;

public int width=0;

public Rectangle(int x, int y
{

length=x;

height=y;

}


public Rectangle(int x, int y, int z)

{

length=x;

height=y;

width=z;

}

}

Report
Re: Java - Rectangle + Origo Posted by Pelle-48 on 28 Nov 2012 at 4:08 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.