Using Java, answer the following You have defined the following java variables,
ID: 3809764 • Letter: U
Question
Using Java, answer the following
You have defined the following java variables, point out good code with [ ok ], syntax errors with [ x ] & briefly explain what is wrong in the ANS lines corresponding to the Line(#) of each statement. int a=1, b=2, c=3, t, //Line(1) String d = The values of a,b,c; //Line(2) a + b + c = t; //Line(3) a = b + c //Line(4) d = a + b + c; //Line(5) System.out.Println( d ); //Line(6) System.out.printLn( d ); //Line(7) system.out.println( d ); //Line(8) JOptionPane.showMessageDialog (Value of d contains: + d); //Line(9)Explanation / Answer
Answer:
in Line1, Issue will semicolon. In java, each statement should terminate will semicolon (;)
in Line 2, ok
in Line 3, t = a + b + c
in Line 4, a = b + c ; semi colon missing
in Line 5, Ok
in Line 6, System.out.println(d); p should be small letter
in LIne 7, System.out.println(d); l should be small letter
In line 8, System.out.println(d); S should be upper letter.
In LIne 9, JOptionPane.showMessageDialog( null, "Value of d contains: '+d); null is missing.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.