Question: Java Debugging Need to Debug Tasks DebugPen.java DebugFour2java 1+ The DebugPen class compiles without >2{ error. private String color; private String point; public DebugPen() {


Tasks DebugPen.java DebugFour2java 1+ The DebugPen class compiles without >2{ error. private String color; private String point; public DebugPen() \{ This task is dependent on color = "black"; completing task \#2. point = "fine"; \} public DebugPen(String color, String point) The DebugPen class methods work f. // Thin class uses a DebugPon clans The DebugPen class compiles without >2// to instantiate two Pen objects error. /l One with default valuea /l and the other with user-supplied valuel import java, util, Scanner: 6 public elass DebugFour? This task is dependent on completing task $2. public static void main(String args []) f. Scanner input = new Scanner ( System. in ) : String color: String point: DebugPen pen1; Debugpen pen2; Systemiout,print ("Enter a color ink for the pen >>= ): efror. color = input , noxtline(); System,out,print ("Entor o point bizo - fine, medium, or thick yy "); The DebugFour 2 program accepts user point = input . nextLine(): input and displays the correct output pen1 = new DebugPen(): pen2 = new DobugPen(point, color); System.out,println("Default value pon:"); di pplay (pen1); Systen, out.printin(-User value pen: "); display ( pon22); 7 public otatie void dioplay(FixDobugPen p) \{ System out.println(" The pen has Ink color " + pigetColor ()); System.out.println(" and a " (" pl.getpoint ()+ "posnt."); 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
