2017-02-13 2 views
-2
import java.util.NoSuchElementException; 


/** 
* VolunteerLine Interface represents the interface for the VolunteerLine Class 

* The class that uses this interface uses a Queue of Volunteers to simulate queuing and dequeuing volunteers to and from the 
* VolunteerLine. 
* @author khandan Monshi 
* 
*/ 

public interface VolunteerLineInterface { 

    /** 
    * adds a new Volunteer to the volunteer line Queue 
    * @param v A Volunteer object 
    * @return true if volunteer is queued successfully , false if queue is full 
    */ 
    public boolean addNewVoluneer(Volunteer v); 

    /** 
    * removes volunteer from the volunteer queue line 
    * @return Volunteer Object 
    * @throws NoSuchElementException if queue is empty 
    */ 
    public Volunteer volunteerTurn() throws NoSuchElementException; 

    /** 
    * checks if there are volunteers in line 
    * @return true if volunteer line is empty, true otherwise 
    */ 
    public boolean volunteerLineEmpty(); 
    /** 
    * Returns an array of the Volunteers in the queue 
    * @return an array of the volunteers in the queue 
    */ 
    public Volunteer[] toArrayVolunteer(); 

} 

을 추가해야 할 말을 유지
import java.util.NoSuchElementException; 

public class VolunteerLine implements VolunteerLineInterface{ 




    @Override 
    public boolean addNewVoluneer(Volunteer v) { 
     // TODO Auto-generated method stub 

      return false; 


    } 

    @Override 
    public Volunteer volunteerTurn() throws NoSuchElementException { 
     // TODO Auto-generated method stub 
     return null; 
    } 

    @Override 
    public boolean volunteerLineEmpty() { 
     // TODO Auto-generated method stub 

      return false;  

    } 

    @Override 
    public Volunteer[] toArrayVolunteer() { 
     // TODO Auto-generated method stub 

    } 

} 

임 난 아직도 내가 해결해야 할 다른 오류가, 아직 함께하지,하지만 난 데 문제가 나는 오류가 계속입니다 "유형 VolunteerLine은 상속 된 추상 메소드 인 VolunteerLineInterface.addNewVoluneer (자원 봉사자)를 구현해야합니다. VolunteerLine에 오류가 있습니다. 마우스를 마우스로 가리키고 구현되지 않은 메서드를 클릭하면 여전히 동일한 오류가 표시됩니다. 내가 잘못하고 있는게 있나요?내가 구현되지 않은 방법

+2

다른 오류를 수정하고 다시 시도하십시오. 깨끗한 빌드가 필요할 수도 있습니다. – shmosel

+3

메소드 이름에 오자가 있음을 알 수 있습니다 : addNewVoluneer (문자 't'가 누락되었습니다) –

+0

나를 잘 컴파일합니다. –

답변

2

다른 컴파일 오류를 수정하고 깨끗한 빌드를 수행하십시오. 귀하가 게시 한 추상적 인 방법의 구현은 정상입니다.

관련 문제