It helps to read your post if you enclose it in code tags.
Since an scjp object is also an instance of the exam class, each scjp object inherits the public print() method. But this inherited method can only "see" the member x of the parent class, namely x="easy". Try variants of this code by overriding print() in scjp, or changing access modifiers.
When a.print() is executed, the context of the method is the base class part of the object. So the value of x is "easy".
If you define a print method in class scjp then the context of the print method will be the scjp class. Then "killing" will be printed.
Compile the classes, and play with the application by moving the print method from base class to derived class. See what happens when you define print in both classes. Change the type of the variable a to exam. What happens?
Fifteen minutes play will teach you a lot about this topic.