Ask your own question, for FREE!
Mathematics 6 Online
OpenStudy (anonymous):

I need help, plz! Design and implement in Java, a class Rectangular tht supports two methods: 1). Area(double x, double y) tht returns the area of a rectangular of width x and length y. 2). perimeter(double x, double y) tht returns the perimeter length of a rectangle of width x & length y.

OpenStudy (anonymous):

@Hero @jim_thompson5910

hero (hero):

I'm pretty sure this is a Computer Science question

OpenStudy (anonymous):

its Information technology!

hero (hero):

But Java is a Computer Science related course. Information Technology is more closely related to Computer Science.

OpenStudy (anonymous):

yea they are similar..

OpenStudy (anonymous):

math456: I need help, plz! Design and implement in Java, a class Rectangular tht supports two methods: 1). Area(double x, double y) tht returns the a…

OpenStudy (tyteen4a03):

I'm going to answer anyway... *sigh* I don't do Java, so if there's any mistakes in my code please auto-correct them. Also note that this is not a CS section - this would fit better in the CS Category. class Rectangular { public static area(double x, double y) { return x*y; } public static perimeter (double x, double y) { return (2*x + 2*y); } } (the static keyword can be omitted but keeping the static method prevents creating this method for every instance of the object that uses this class.)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!