Hello to everybody. I'm the newest member of this forum.
For my first thread I ask you who can resolve this exercise and publish the code in this forum?
Implement a subclass Square that extends the Rectangle class. In
the constructor, accept the x- and y-positions of the center and the side length of
the square. Call the setLocation and setSize methods of the Rectangle class.
Look up these methods in the documentation for the Rectangle class. Also supply
a method getArea that computes and returns the area of the square.Write a sample
program that asks for the center and side length, then prints out the square (using
the toString method that you inherit from Rectangle) and the area of the square.
Re: Hello everybody
Hello Vampoja, welcome to the Java Programming Forums.
I'm afraid no one is going to do your homework assignment for you. The forums are here to help you but you need to show us you have at least attempted to solve the exercise yourself first. Please post the code you have so far and give us as much information as possible about the problems you are facing.
We can take it from there.. Thanks.