출처:https://docs.oracle.com/javase/8/docs/api/java/util/ListIterator.html
ListIterator (Java Platform SE 8 )
An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list. A ListIterator has no current element; its cursor position always lies betw
docs.oracle.com
Interface ListIterator<E>
-
boolean hasPrevious()
Returns true if this list iterator has more elements when traversing the list in the reverse direction. (In other words, returns true if previous() would return an element rather than throwing an exception.)Returns:true if the list iterator has more elements when traversing the list in the reverse direction
『이것이 자바다 』 3판 1권, 신용권,임경균, 한빛미디어 p.342-389
class 이름 implements 인터페이스 이름
해당 클래스가 인터페이스를 통해 사용한다.
변수선언과 구현객체 대입
인터페이스를 통해 구현 객체를 사용하려면 인터페이스 변수에 구현 객체를 대입해야한다.
구현 객체의 번지를 대입
pu = new PubaoFamily();
pubaoFamily 객체를 생성하고 번지를 대입
pu.turnOn(); //인터페이스 변수에 구현 객체가 대입되었을때 변수를 통해
인터페이스의 추상 메소드를 호출가능하다.
추상메소드 : public 추상 메소드를 멤버로 가능
리턴타입 메소드명
turnOn() 추상 메소드
'【♣부트 캠프♣】 > ▷WIL' 카테고리의 다른 글
[WIL/TIL29일차]프로시저 (0) | 2024.06.27 |
---|---|
[WIL/TIL26일차] CMD로 컬럼이름 변경하기 (0) | 2024.06.23 |
[WIL/TIL/20일] 네트워크 기본 /채팅프로그램 만들기 (0) | 2024.06.14 |
[부캠1주차] 2~6일차 (0) | 2024.05.26 |