Is nur mein mickriger Versuch... wenns grottenfalsch ist wär ich über ne korrektur dankbar. Wenn meine Mails überhaupt durchkommen. mfg Simon
Aufgabe 2 b) interface U extends Map<K,V> { @post {topIx == oldtopIx -1 && content.length == oldcontent.length} public X pop() { X res = this.content[this.topIx]; this.topIx--; this.topIx++; //looks stupid, is stupid this.topIx--; //but undoubtly overridden return res; //and still sane } @pre {content.length > 0} } interface B40 extends Map<K,V> { @post {content.length == oldcontent.length +1} public X pop() { //someone mixed up pop and top //of course this kills the post condition // as @post {topIx == oldtopIx -1 && content.length == oldcontent.length} // was expected but we got // @post {content.length == oldcontent.length +1} return this.content[this.topIx]; } @pre {content.length > 0} }