The second wrong answer in Pass4Sure 1Z0-851

Hi every one …warning-sign[6]

There is another question that have been solved wrongly in Pass4Sure in SCJP 1Z0-851 [1/6/2011].

 

Here is the question:

What is the result?

  1. 1.   public class GoTest {
    2.      public static void main(String[] args) {
    3.           Sente a = new Sente(); a.go();
    4.           Goban b = new Goban(); b.go();
    5.           Stone c = new Stone(); c.go();
    6.      }
    7.   }
    8. 
    9.   class Sente implements Go {
    10.       public void go() { System.out.println("go in Sente."); }
    11.  } 
    12. 
    13.  class Goban extends Sente {
    14.       public void go() { System.out.println("go in Goban"); }
    15.  }
    16.
    17. class Stone extends Goban implements Go { }
    18. 
    19. interface Go { public void go(); }
  2. A. go in Goban
        go in Sente

  3.  

  4. B. go in Sente
        go in Goban


  5. C. go in Sente
        go in Goban


  6. D. go in Goban
        go in Sente


  7. E. Compilation fails because of an error in line 17.

The answer Pass4Sure was: C

But the answer must be Non of the above.

First of all there are two answers that are similar.
Secondly the output must be:

go in Sente
go in Goban
go in Goban

It seems to be misprinting, because in previous versions was true.

I have tried it on NetBeans, the class:

/**
*
* @author Ahmad Attallah –www.hope-sun.net-
*/
public class GoTest {

    public static void main(String[] args) {
        Sente a = new Sente();
        a.go();
        Goban b = new Goban();
        b.go();
        Stone c = new Stone();
        c.go();
    }
}

class Sente implements Go {

    public void go() {
        System.out.println("go in Sente");
    }
}

class Goban extends Sente {

    public void go() {
        System.out.println("go in Goban");
    }
}

class Stone extends Goban implements Go {
}

interface Go {

    public void go();
}

هناك تعليقان (2):

  1. الله ينور عليك يا بشمهندس

    ردحذف
  2. وعليك يا حبي .
    أخبارك ايه دلوقتي ، واحشني كتييييييييييييييير

    ردحذف

---- أتشرف بتعليقاتكم ----