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.55 Rating (152 Votes )
There are 3 Steps involved in it
In the code for the Square class provided in Figure 813a the this prefix is used to refer to the ins... View full answer
Get step-by-step solutions from verified subject matter experts
