Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kap6;
- public class Ort<E> {
- private int ortsId;
- private E e;
- public Ort(int ortsId){
- this.ortsId = ortsId;
- }
- public E entnehmen(){
- return e = null;
- }
- public void hinzufügen(E e){
- this.e = e;
- }
- public E getEingelagertesElement(){
- return e;
- }
- public boolean istBelegt(){
- return !(e==null);
- }
- public int getOrtsId(){
- return ortsId;
- }
- @Override
- public String toString(){
- return ortsId + " " + String.valueOf(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement