Podcast
Questions and Answers
What will happen when the command 'java Simple' is run?
What will happen when the command 'java Simple' is run?
- The Java compiler will create a file named Simple.class
- An error will occur due to missing file extension
- The java command will assume the extension is .class and run the file (correct)
- The command will result in a runtime exception
Which statement about comments in Java programs is true?
Which statement about comments in Java programs is true?
- Only single-line comments are allowed in Java programs
- Comments are terminated by the code within their curly braces
- Comments are required to end with a semi-colon
- Comments are ignored by the Java compiler (correct)
What must every Java application have?
What must every Java application have?
- A class header
- A main method (correct)
- Multiple public classes
- Curly braces
What does the statement 'System.out.println("Programming is great fun.");' illustrate?
What does the statement 'System.out.println("Programming is great fun.");' illustrate?
What is true about the file extension for Java programs?
What is true about the file extension for Java programs?
Which file extension is needed for a Java source code file?
Which file extension is needed for a Java source code file?
In Java, if a source code file contains more than one class, what is the requirement for one of the classes?
In Java, if a source code file contains more than one class, what is the requirement for one of the classes?
Which method is used to compile a Java source code file?
Which method is used to compile a Java source code file?
What must match in a Java source code file?
What must match in a Java source code file?
Which keyword is used for declaring local variables with an inferred type in Java?
Which keyword is used for declaring local variables with an inferred type in Java?