Primitives- Numeric data types QuizS2C Home « Primitives- Numeric data types 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 & Syntax | For this lesson we look at the code structure of a Java source file and look at some syntax. | Quiz1 8 questions |
Lesson 3 - Java Variables | This lesson is about the variables we use in Java. | Quiz2 7 questions |
Lesson 4 - Primitives - boolean & char data types | This lesson is about the boolean & char primitive data types available in Java. | Quiz3 7 questions |
Lesson 5 - Primitives - Numeric data types | In this lesson we look at the numeric primitive data types available in Java. | This quiz. 7 questions |
Lesson 6 - Method Scope | In this lesson we look at Java method scope and what scope and its definition mean. | Quiz5 8 questions |
Lesson 7 - Arithmetic Operators | In our first lesson on operators we look at the arithmetic operators available for use in Java. | Quiz6 6 questions |
Lesson 8 - Relational & Logical Operators | In our second lesson on operators we look at the relational & logical operators available for use in Java. | Quiz7 6 questions |
Lesson 9 - Assignment Operators | In our third lesson on operators we look at the assignment operators available for use in Java. | Quiz8 6 questions |
Lesson 10 - Bitwise Logical Operators | In our fourth lesson on operators we look at the Java bitwise logical operators. | Quiz9 7 questions |
Lesson 11 - Bitwise Shift Operators | In our fifth lesson on operators we look at the Java bitwise shift operators. | Quiz10 7 questions |
Lesson 12 - if Construct | In this lesson we make a thorough investigation of the if construct | Quiz11 8 questions |
Lesson 13 - switch Construct | In this lesson we look at the switch construct | Quiz12 7 questions |
Lesson 14 -for Construct | In this lesson we investigate the for construct. | Quiz13 7 questions |
Lesson 15 - while Construct | In this lesson we look at the while construct. | Quiz14 8 questions |
Fundamentals Quiz 4
The quiz below tests your knowledge of the material learnt in Fundamentals - Lesson 5 - Primitives - Numeric data types.
Question 1 : What will be returned from the following code?
long aLong = 3672543567;
System.out.println("aLong = " + aLong);?
long aLong = 3672543567;
System.out.println("aLong = " + aLong);?
- We get a compiler error. When we pass a literal value to a long we need to append l or L to it or the compiler inteprets it as an integer. Because an integer has a range of -2,147,483,648 to 2,147,483,647 the number is out of range even though we passed it to a long primitive type.
Quiz Progress Bar
What's Next?
The next quiz on Java is about the method scope and the Stack
.