# Arithmetic Operators QuizJ8 Home « Arithmetic Operators Quiz

The questions in this Java quiz are on the topics covered in the Java - Fundamentals 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.

### Fundamentals 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.

Fundamentals 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.Quiz1
8 questions
Lesson 3 - Java VariablesThis lesson is about the variables we use in Java.Quiz2
7 questions
Lesson 4 - Primitives - `boolean` & `char` data typesThis lesson is about the `boolean` & `char` primitive data types available in Java.Quiz3
7 questions
Lesson 5 - Primitives - Numeric data typesIn this lesson we look at the numeric primitive data types available in Java.Quiz4
7 questions
Lesson 6 - Method ScopeIn this lesson we look at Java method scope and what scope and its definition mean.Quiz5
8 questions
Lesson 7 - Arithmetic OperatorsIn the first of five lessons on operators we look at the arithmetic operators available in Java..This quiz.
6 questions
Lesson 8 - Relational & Logical OperatorsIn our second lesson on operators we look at the relational & logical operators available for use in Java.Quiz7
6 questions
Lesson 9 - Assignment OperatorsIn our third lesson on operators we look at the assignment operators available for use in Java.Quiz8
6 questions
Lesson 10 - Bitwise Logical OperatorsIn our fourth lesson on operators we look at the Java bitwise logical operators.Quiz9
7 questions
Lesson 11 - Bitwise Shift OperatorsIn our fifth lesson on operators we look at the Java bitwise shift operators.Quiz10
7 questions
Lesson 12 - `if` ConstructIn this lesson we make a thorough investigation of the `if` constructQuiz11
8 questions
Lesson 13 - `switch` ConstructIn this lesson we look at the `switch` constructQuiz12
7 questions
Lesson 14 -`for` ConstructIn this lesson we investigate the `for` construct.Quiz13
7 questions
Lesson 15 - `while` ConstructIn this lesson we look at the `while` construct.Quiz14
8 questions

### Fundamentals Quiz 6

The quiz below tests your knowledge of the material learnt in Fundamentals - Lesson 7 - Arithmetic Operators.

Question 1 : What values do `a` and `b` hold after the following expressions?

`int a = 5; int b = 10; b = a++;`
- a = 6 and b = 5 as the the postfix increment is applied after the expression is evaluated.
Question 2 : What value does `b` hold after the following expressions?

`int b = 5; b = b % 2;`?
- The % symbol is the modulus and as such holds the remainder of a divisional computation and so <code>b</code> holds the value <code>1</code> after the expressions <code>int b = 5; b = b % 2;</code> are evaluated.
Question 3 : What value does `b` hold after the following expressions?

`int b = 7; b = 22 / b;`
- When division is used with an integer type, any remainder will be truncated and so <code>c</code> holds the value <code>3</code> after the expressions <code>int b = 7; b = 22 / b;</code> are evaluated..
Question 4 : Can the result of a modulus calculation be 0?
- If there is no remainder the result of a modulus calculation will be <code>0</code>.
Question 5 : What value does `b` hold after the following expressions?

`byte a = 1;byte b = ++a;`
- The prefix increment is applied before the expression is evaluated so after this <code>a = 2</code> and so the answer is <code>2</code>.
Question 6 : What value does `b` hold after the following expressions?

`byte a = 1;byte b = a++;`
- The postfix increment is applied after the expression is evaluated so after this <code>a = 1</code> and so the answer is <code>1</code>.

## What's Next?

The next quiz on Java is all about relational and logical operators available in Java.