Homework Clinic
Science Clinic => Computer Science => Programming and Graphic Design => Topic started by: krzymel on Aug 30, 2020
-
Question 1
Which of the following is not syntactically legal in Java?
◦ public class Foo
◦ System.out.println("Hi");
◦ { }
◦ s t a t i c main(String[ ] args)
◦ only System.out.println("Hi"); is legally valid, all of the rest are illegal
Question 2
Which of the following is true regarding Java syntax and semantics?
◦ a Java compiler can determine if you have followed proper syntax but not proper semantics
◦ a Java compiler can determine if you have followed proper semantics but not proper syntax
◦ a Java compiler can determine if you have followed both proper syntax and semantics
◦ a Java compiler cannot determine if you have followed either proper syntax or semantics
◦ a Java compiler can determine if you have followed proper syntax and can determine if you have followed proper semantics if you follow the Java naming convention rules
-
Answer 1
s t a t i c main(String[ ] args)
Answer 2
a Java compiler can determine if you have followed proper syntax but not proper semantics
-
Thank You
this is skem btw, they force to sign up