Building Java Programs: A Back To Basics Approach (5th Edition)
Building Java Programs: A Back To Basics Approach (5th Edition)
5th Edition
ISBN: 9780135471944
Author: Stuart Reges, Marty Stepp
Publisher: PEARSON
bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 1.3, Problem 20SCP

Explanation of Solution

Error #1:

Error:

In line 1, the statement is missing a“{” parenthesis.

Error #2:

Given statement:

//define main method

public static void main(String[]){

Error:

In line 2, the statement is missing keyword “args”.

Corrected statement:

//define main method

public static void main(String[] args){

Error #3:

Given statement:

//print the statements

System.out.println(" t hat"); /* this part should

System.out.println("all");     really say,

System.out.println("men");    "all PEOPLE! " */

Error:

In line 8: the comment on lines 8-10 accidently comments out lines 9-10 of the program. The comments should be given using “//” to fix the problem.

Corrected statement:

System.out.println(" t hat"); //this part should

System.out.println("all");    //really say,

System.out.println("men");    //"all PEOPLE! "

Error #4:

Given statement:

System.out.println("are";

Error:

In line 11, a closing parenthesis“)” is missing...

Blurred answer
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY