이클립스

Kotlin & Java

What is CALL BACK? 콜백

콜백의 정의는 호출자가 피호출자를 호출하는 것이 아니라피호출자가 호출자를 호출하는 것을 말한다. 콜백의 장점은 어떤 특정 조건이 만족 되었을 때 지정한 기능을 수행할수 있어 비동기로 효율적으로 기능을 수행할 수 있습니다.(안드로이드에서 워낙 많이 사용해본 기억.) 일단 구현해보자! 저만의 방식으로 구현해봤습니다. 언제나 날카로운 지적 부탁드립니다. package algo;public class callback implements CallBackInterface { public void test(){ TestClass testClass = new TestClass(); testClass.setCallBack(this); testClass.callWork(); } @Override public void ca..

Kotlin & Java

자바 객체 비교

자바 객체를 비교할때 equals 뿐만 아니라 hashode도 오버라이드 해줘야 하는 이유 public class Student { private int student_id; private String name; private String major; public int getStudent_id() { return student_id; } public void setStudent_id(int student_id) { this.student_id = student_id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMajor() { return m..

Nanamare
'이클립스' 태그의 글 목록