public class Rectangle {
private int left; //x-cooridinate of left edge
private int bottom; //y-coordinate of bottom edge
private int width; //width of rectangle
private int height; //height of rectangle
/**
* @param args
*/
public String toString()
{
String d= ("left-base:("+left+","+bottom+") width:"+width+" height:"+height);
return d;
}
public Rectangle (int one,int two, int three, int four)
{
if (one<0)
{
one=0;
}
if (two<0)
{
two=0;
}
if (three<0)
{
three=0;
}
if (four<0)
{
four=0;
}
left = one;
bottom= two;
width= three;
height= four;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.