Type the statements. Then, correct the one syntax error in each statement. Hints
ID: 3785588 • Letter: T
Question
Type the statements. Then, correct the one syntax error in each statement. Hints: Statements end in semicolons, and string literals use double quotes. System.out.printl("Predictions are hard."); System.out.print("Especially '); System.out.println("about the future."). System.out.println("Num is: " - userNum); Challenge 1.9 Activity Basic syntax errors Type the statements. Then, correct the one syntax error in each statement. Hints: Statements end in semicolons, and string literals use double quotes. System. out. printl ("Predictions are hard." System.out.print Especially System out. println("about the future. System.out.println ("Num is userNum); import java util Scanner; 1 3 public class Errors 4 public static void main(String args) 1 int userNum 5; Your solution goes here return 10 11 Run View your last submission Feedback?
Explanation / Answer
1. --> system.out.println("predictions are hard");. Check underlined
2-->. System.out.print("Especially "); here strings should be in double quotations
3 --> system.out.println("about the future"); syntax should end with semi colon
4 --> system.out.println("Num is: " + userNum); minus will consider as syntax error + symbol is used for output of print string concatenation with variable.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.