Exercise 5: The following code includes 10 compilation errors (an error per line). a) Find and correct them. b) Give the exact output after correcting the code
The following code includes 10 compilation errors (an error per line).
Find and correct them.
Give the exact output after correcting the code.
/ Try to find the errors
Public class Test1 {
public static main(String[] a) {
System.out.println('Welcome');
System.out.printIn("to");
System.out.println("M105);
System.out.print("Nice ")
System.out.println(Program);
{
]
line 1: missing back slash for the comment: //
line 2: Public should start with small letter: public
line 3:missing "void" after static
line 4: welcome should be between double quotations: "welcome"
line 5: printIn should be: println
line 6: "M105 should be: "M105""M105
line 7: missing ; in the end of line
line 8: Program should be between double quotations: "Program"
line 9: parenthes { should be reversed: }
line 10: ] should be : }
need an explanation for this answer? contact us directly to get an explanation for this answer