Object Oriented Programming (OOPs)

© examsiri.com
Question : 16 of 72
 
Marks: +1, -0
Which three code fragments, added individually at highlighted, produce the output 100? (choose 3)
class Inner{
  private int x;
  public void setX(int x) {
    this.x=x;
  }
 public int getX(){
   return x;
 }
}
class Outer{
  private Inner y;
 public void setY(Inner y) {
    this.y=y;
  }
 public Inner getY(){
    return y;
  }
}
public class Gamma{
 public static void main(String [] args){
  Outer o=new Outer();
 Inner i=new Inner();
  int n=10;
 i.setX(n);
  o.setY(i);
 /* insert code here. */
  System.out.println(o.getY().getX());
 }
}
Go to Question: