First of all the variable defined as "difficultyLevel" is having the value as "Easy" in both ur super class and sub class. So how did u differentiate between the outputs?
Anyways, let me explain u:
1) Always remember that the variables(instance or static) are
never inherited. They are
hidden .
In this example of urs, the variable difficultyLevel called within the class Exam belongs to the class Exam and the one defined within the class SCJPExam belongs to the SCJPExam.
The invoked method printDifficultyLevel() present in the class Exam uses the variable "difficultyLevel" which is
hidden from the same variable declared in the class SCJPExam, right?
So u get the kind of output mentioned.