Question: For the Square class in Figure 8.13a, rewrite the Square constructor and the getArea method so that theres no this prefix. Figure 8.13a: /******** *
For the Square class in Figure 8.13a, rewrite the Square constructor and the getArea method so that there’s no this prefix.
- Figure 8.13a:

/******** * Square.java Dean & Dean * *This class manages squares. ************** import java.util. Scanner; public class Square. { private int width; //********** public Square (int width) ( } this.width = width; public double getArea() { } return this.width * this.width; // ****************** public void draw() { drawBorder Square (); Scanner stdIn = new Scanner (System.in); } else { ******************* drawSolidSquare (); ***************************** System.out.print("Print with (b) order or (s)olid? "); if (stdIn. nextLine().charAt (0) == 'b') ( } 3 // end draw ******* ********************************
Step by Step Solution
3.50 Rating (157 Votes )
There are 3 Steps involved in it
The task involves removing the this keyword from the constructor and the getArea method in the Squar... View full answer
Get step-by-step solutions from verified subject matter experts
