Question: Why is this wrong? Compile Undo Cut Copy Paste Find Close public class DollApp { public static void main(String[]args) { Scanner in = new Scanner(System.in);
Compile Undo Cut Copy Paste Find Close public class DollApp { public static void main(String[]args) { Scanner in = new Scanner(System.in); System.out.println cannot find symbol Doll doll1 = new Doll: class Scanner doll1.pressMe(); doll1.setName("Rita"); doll1.pressMe : System.out.print("Would you like to set name?Y/N:> "); char choice = in.next().charAt(0); in.nextLine(): if((choice =='Y'11(choice =='y')){ System.out.print("Enter the name: "); String name=in.nextLine(); doll1.setName(name): } dolli.pressMe(); Class has to be compiled to set breakpoints
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
