Question
Examine the following Java-like code:Â Â Â
```java   class Parent {     String name = "Parent";     public void display() {       System.out.println(name);     }   }   class Child extends Parent {     String name = "Child";     // No display method override   }   public class Main {     public static void main(String[] args) {       Parent p = new Child();       p.display();     }   }   ```   What will be the output?Solution
This demonstrates variable hiding (not overriding) and method overriding. Â Â Â Â Â Â `Parent p = new Child();` creates a `Child` object but the reference `p` is of type `Parent`. Â Â Â Â Â Â When `p.display()` is called, Java uses dynamic method dispatch (polymorphism) to call the `display()` method of the actual object type, which is `Child`. Â Â Â Â Â Â However, `Child` does not override the `display()` method. Therefore, the `display()` method from the `Parent` class is executed. Â Â Â Â Â Â Inside `Parent.display()`, `name` refers to `Parent.name`, which is "Parent". The `Child`'s `name` variable is a separate, hidden variable.
Statement: F ≥ G > I > E ≤ P, E = S ≥ PÂ
Conclusion: I. F ≥ P         II. G > P
Statement: Y < Z > I < Q > S = M ≤ N
Conclusions:
I. S= N
II. Q > M
Statements: P = Q = R > S > T > Z; U > R < V < W > X
Conclusions:
I. W > Z
II. R < W
III. R < X
In the question, assuming the given statements to be true, find which of the conclusion (s) among given three conclusions is /are definitely true and ...
Statements: E < F > G; H < I ≤ F; E > D
Conclusions:
I. F > D
II. H < E
III. G < DWhich of the following will be definitely false if the given expression F > G ≥ H > I ≥ J > K = M ≤ N > L ≤ O is definitely true?
Statements: Â M @ N, P @ R, P & N
Conclusions:Â Â Â Â Â a ) M @ PÂ Â Â Â Â Â Â Â Â Â Â Â Â b) R & M
...Statement: F < G; H ≥ I; H ≥ K; I > G ≥ J
Conclusion:
I. G > K
II. K > J
Statements: S = R, T ≤ U, O < J, T ≤ J, U > R
Conclusion:
I. R ≥ T
II. R < T
Statement: D < F; D ≥ E > G; I ≥ H > F
Conclusion:
I. G ≥ F
II. H ≥ D