33.3k views
1 vote
Which of the following does not contain a syntax error? a. System.out.println("Hello world!"); b. System.out.println(Hello world!); c. System.out.println('Hello world!'): d. System.out.println("Hello world!");

User Forkmohit
by
4.6k points

2 Answers

3 votes

Answer:

Option A and B

Step-by-step explanation:

:)

User Naib
by
4.3k points
2 votes

Answer:

a. System.out.println("Hello world!");

d. System.out.println("Hello world!");

Step-by-step explanation:

Option b doesn't have the apostrophe within the bracket so it's incorrect.

Option c doesn't have the correct double apostrophe within the bracket so it's incorrect. Running option b and c code will not compile properly and give an error.

User Ramiro Herrera
by
5.2k points