How to Write Your First Java Application - Quiz

Total: 7 questions

1. What is the entry point of a Java program?
The main() method — execution always starts there.
2. Why does the main method need the static modifier?
So the JVM can call it without creating an object of the class.
3. What does String[] args mean in the main signature?
An array of strings holding command-line arguments.
4. Why must the filename match the public class name?
The compiler requires it: class MyFirstApp must be in MyFirstApp.java.
5. What happens to a class without a main() method?
It compiles, but the java command can't run it.
6. How does every statement in Java end?
With a semicolon (;).
7. Is Java case-sensitive?
Yes: Main and main are different names.
Page 1 of 1