Total members 11895 |It is currently Sun Dec 22, 2024 3:15 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





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());
}
 





Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time

For example :

Code:

 
private  float side 


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

.....

 


_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 2 posts ] 

  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     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com