90.6k views
0 votes
Which of the following would not be syntactically legal in Java?

A) public class Foo
B) .printIn ("Hi");
C in x = 0;
D) sta tic main(Sting[]) args);

User BradC
by
8.2k points

1 Answer

3 votes

Final answer:

The option that is not syntactically legal in Java is 'D) sta tic main(Sting[]) args)' due to misspelled keywords and missing elements in the method signature.

Step-by-step explanation:

The syntactically illegal option in Java among the given choices is D) sta tic main(Sting[]) args). The correct syntax should be public static void main(String[] args). The keyword static is misspelled as 'sta tic', and String is misspelled as 'Sting'. Additionally, the return type 'void' and the visibility modifier 'public' are missing.

User Cppiscute
by
8.3k points