Category: Java quizzes

Java quiz 04: Overriding methods

Hi guys, Here is a Java quiz. If you can solve this quiz and understand the right explanation of the answer, you are really good in Java! Of course, I mean before you read the answer explanation below :-). Java quiz 4: Overriding methods Level: Hard Note: The classes Item and Book are two separate files in […]

Java quiz 03: Static and instance variables

It is important for every Java programmers to understand the difference between class(static) variables and instance variables. Therefore I wrote this quiz, which clarifies those differences. Java quiz 3: The difference between static and instance variables Level: Normal What is written to the standard output as the result of executing the following code? Author: Sar […]

Java quiz 02: Simple conditional statements

Here is a Java quiz about conditional statements. Note that there is a difference between a sequence of if statements and a sequence of else if statments. If you don’t know that, please, read my article first by clicking here. Java quiz 2: Simple conditional statements Level: Easy What is written to the standard output […]

Java quiz 01: Passing parameters to constructors

I would emphasize that understanding constructors helps you by initializing instance variables. In the following code, I try to make that concept clear. I use a trick to make it difficult to guess the result if you don’t understand the constructor block. Java quiz 1: Passing parameters to constructors Level: Normal What is the output […]