Question: I changed the class name to Engine Now I have a problem with line 4. What do I do now? Package Explorer X 68 IN300M

I changed the class name to "Engine" Now I have a problem with line 4. What do I do now?

I changed the class name to "Engine" Now I have a problem

Package Explorer X 68 IN300M JRE System Library [JavaSE-14] src # (default package) > Engine.java 11 12 13 14 = Engine.java X 1 import java.util.*; 2 public class Engine { 30 public static void main(String args[]) { Scanner sc = new Scanner(System.in); String locomotivel, locomotive2, locomotive3, locomotive4, locomotives, common; System.out.print("locomotivel "); locomotivel = sc.nextLine(); System.out.print("locomotive2 - "); 9 locomotive2 = sc.nextLine(); System.out.print("locomotive3 "); locomotive3 = sc.nextLine(); System.out.print("locomotive4 "); locomotive4 = sc.nextLine(); System.out.print("locomotives "); 15 locomotive5 = sc.nextLine(); System.out.print("common = "); common = sc.nextLine(); ArrayList engine = new ArrayList(); 19 engine.add(locomotivel); engine.add(locomotive2); 21 engine.add(locomotive3); 22 engine.add(locomotive4); engine.add(locomotive5); engine.add(common); 25 System.out.println("The values are :"); for(String i : engine) { 27 System.out.println(i); 28 29 30 } 16 17 18 20 23 24 26 } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!