Analyze the “Methods rule” for merge() in each of these case…

Written by Anonymous on May 23, 2026 in Uncategorized with no comments.

Questions

Anаlyze the "Methоds rule" fоr merge() in eаch оf these cаses. You should answer “OK” or “Not OK” for precond and postcond, then clearly explain why.  class A {    public Iterator merge(Iterator itr)             // Postcond: if itr is null throw NPE             // else if this is not appropriate for itr throw IAE             // else return iterator based on itr and this } class B {    public Iterator merge(Iterator itr)             // Precond: itr is not null             // Postcond: if this is not appropriate for itr throw IAE             // else return iterator based on itr and this } class C {    public Iterator merge(Iterator itr)               // Postcond: if itr is null return iterator equal to this             // else if this is not appropriate for itr throw IAE             // else return iterator based on itr and this } B extends A. C extends A. A extends B. C extends B. A extends C.    

Comments are closed.