Code Structure & Syntax QuizS2C Home « Code Structure & Syntax Quiz

The questions in this Java quiz are on the topics covered in the Java - Beginning Java section of the site. The table below lists the lesson used for each quiz, a description of the lesson content and the quiz number and questions associated with that lesson.

Beginning Java Quizzes Summary

Click on a lesson in the table to go to that lesson for a refresher on the topics for that quiz.

Click on a quiz in the table to go straight to the quiz for a particular lesson.

Beginning Java Lessons Description Quiz Info.
Lesson 2 - Code Structure & SyntaxFor this lesson we look at the code structure of a Java source file and look at some syntax.This quiz.
8 questions
Lesson 3 - Primitive VariablesThis lesson is about the primitive variable data types available in Java.Quiz2
8 questions
Lesson 4 - Method ScopeIn this lesson we look at Java method scope and what scope and its definition mean.Quiz3
8 questions
Lesson 5 - OperatorsThis lesson is the first of two about the symbols used in Java for mathematical and logical manipulation.Quiz4
6 questions
Lesson 6 - Bitwise OperatorsIn our second lesson on operators we look at the Java bitwise operators.Quiz5
6 questions
Lesson 7 - Conditional StatementsIn this lesson we look at the conditional statements available in Java.Quiz6
8 questions
Lesson 8 - Loop StatementsThis lesson is all about the loop statements available in Java.Quiz7
8 questions

Beginning Java Quiz 1

The quiz below tests your knowledge of the material learnt in Beginning Java - Lesson 2 - Code Structure & Syntax.

Question 1 : Which of the following goes inside a class definition?
- Methods go inside a class definition.
Question 2 : We use the java command to compile programs in Java?
- We use the javac command to compile programs.
Question 3 : What does the void keyword specify?
- The void keyword specifies that nothing is returned from the method.
Question 4 : How do we run a file called Hello.class that contains a main() method?
- We run a file called Hello.class using java Hello.
Question 5 : Who has access to a public class?
- A public class can be accessed by anyone.
Question 6 : How do we compile a file called Hello.java?
- We compile a file called Hello.java using javac Hello.java
Question 7 : A statement contains methods?
- A method contains statements.
Question 8 : A source file should be named after its class?
- A source file should be named after it's class. In fact if the class is public and you name the source file differently and try to compile it you get an error.
Quiz Progress Bar Please select an answer

What's Next?

The next quiz on Java is all about primitive variables.