Question: please correct the lines of code based on the compiler error messages. public class DisplayMesg.java { public static void main(String[] args) { System. out.println(Welcome to

please correct the lines of code based on the compiler error messages.
please correct the lines of code based on the compiler error messages.
public class DisplayMesg.java \{ public static void main(String[] args) \{ System. out.println("Welcome
to Java"); System.out.println("Welcome to Computer Science"); System.out.println("Programming is fun"); Exercise01 01.java: 3:

public class DisplayMesg.java \{ public static void main(String[] args) \{ System. out.println("Welcome to Java"); System.out.println("Welcome to Computer Science"); System.out.println("Programming is fun"); Exercise01 01.java: 3: error: ' { ' expected public class DisplayMesg.java \{ 1 erron 1. 3 public class DisplayMesg.java \{ public static void main(String[] args) f System.out.println("Welcome to Java"); System.out.print1n("Welcome to Computer Science"); System, out.printin("Programming is fun"); public class Main \{ public static vold main(String[] args) \{ double result1 9.54.52.53; double result 2 - 45.53.5; System.out.printin( Result 1: + result1); System.out, println("Result 2:"+result2 ); Exercisee1 05. java:3: error: class Main is public, should be dectared in a flie named Main.java public class Main i 1 ernor 21 7ublic class MaLn ( public statle vold main(String[] args) f doubte resuitt =9.54.52.53; double resultz =45.5=3.5; Systemiout. println( Result i: - + result 1 ) System, out.print ln ("Result 2:+ +result 2 ); public class Main \& public static void main(String[] args) \{ double result 1=9.54.52.53; double result =45.53.5; System.out. println("Result 1:"+ result 1 ); System.out.print ln("Result 2:+ result 2 ); \} COMPILER ERROI MESSAGES Exercise01_05. Java:3: erron: class Main is public, should be declared in a file nared Main. Java public class Main \{ 1 error

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!