Primitives- Numeric data types QuizS2C Home « Primitives- Numeric data types Quiz
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
Quiz 1
Code Structure & Syntax
![Code Structure and Syntax diagram Code Structure and Syntax diagram](../images/codestruct.webp)
Quiz 2
Java Variables
![Java Variables diagram Java Variables diagram](../images/javavariables.webp)
Quiz 3
Primitives - boolean
& char
data types
![Primitives boolean and char data types diagram Primitives boolean and char data types diagram](../images/primvariables.webp)
Quiz 5
Method Scope
![Method Scope diagram Method Scope diagram](../images/scope.webp)
Quiz 6
Arithmetic Operators
![Arithmetic Operators diagram Arithmetic Operators diagram](../images/operators.webp)
Quiz 7
Relational & Logical Operators
![Relational and Logical Operators diagram Relational and Logical Operators diagram](../images/rellogoperators.webp)
Quiz 8
Assignment Operators
![Assignment Operators diagram Assignment Operators diagram](../images/assignoperators.webp)
Quiz 9
Bitwise Logical Operators
![Bitwise Logical Operators diagram Bitwise Logical Operators diagram](../images/bitwiseoperators.webp)
Quiz 10
Bitwise Shift Operators
![Bitwise Shift Operators diagram Bitwise Shift Operators diagram](../images/bitwiseshiftoperators.webp)
Quiz 11
if
Construct
![if Construct diagram if Construct diagram](../images/conditional.webp)
Quiz 12
switch
Construct
![switch Construct diagram switch Construct diagram](../images/switch.webp)
Quiz 13
for
Construct
![for Construct diagram for Construct diagram](../images/forloop.webp)
Quiz 14
while
Construct
![while Construct diagram while Construct diagram](../images/while.webp)
What's Next?
The next quiz on Java is about the method scope and the Stack
.