강의

멘토링

커뮤니티

Inflearn Community Q&A

olivee's profile image
olivee

asked

Coding test top basic problems that are really easy to solve (with Java)

Meeting Room

meetingroom에서 comp ㅠㅠ이해가..

Written on

·

262

1

comparator가 util 모듈로 임포트 되서

};

인건가요?

Comparator<Interval> Comp = new Comparator<Interval>() {

@Override

public int compare(Interval a, Interval b) {

// TODO Auto-generated method stub

return a.start - b.start;

}

};

meetingroomjavacomparator코테 준비 같이 해요!

Answer 1

1

pushupman님의 프로필 이미지
pushupman
Instructor

안녕하세요~?

이지선님 ~

질문주신 : comparator가 util 모듈로 임포트 되는가요?

네 맞습니다.  comparator를 사용할려면 프로그램 상단의 import.java.util.* 이렇게 표시해주면됩니다.

comparator는 자바에서 자주 쓰입니다.

내부적으로 compareTo()를 이용합니다. 아래내용을 참고해주세요~

olivee's profile image
olivee

asked

Ask a question