Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

Java Rectangle Class

Wed May 05, 2010 10:57 pm

Hi could anyone please help me complete the following code.

Code:

class Rectangle
{
    [b]add appropriate code here[/b]
}

public class UseRectangle
{
    Rectangle r = new Rectangle();

    r.setLength(4.3);  //sends a message to r telling it what length of side to have
    r.setBreadth(3.9);
    System.out.println("..." + r.reportArea());
    System.out.println("..." + r.reportLengthAroundEdge());
    System.out.println("..." r.reportLengthFromAnyCornerToTheOneDiagonallyOpposite());
}
 




Re: help with some missing coding

Thu May 06, 2010 9:20 am

For example :

Code:

 
private  float side 


   public 
void setLength(float side){
             
this.side side
   }

.....

 


Post a reply
  Related Posts  to : Java Rectangle Class
 Drawing rectangle using stars in java     -  
 java abstract class,concrete class and interface     -  
 Ellipse in Rectangle     -  
 Java Email Class     -  
 Java Television class     -  
 Draw rectangle on image     -  
 Draw Fill Rectangle     -  
 How to Calculate Volume of a Rectangle     -  
 Nested classes(inner class) in java     -  
 ellipse, circle, rectangle, square, or parallelogram     -