본문 바로가기
Class/220728

Class(1-2)

by pms93 2022. 7. 28.
package constructor;

public class Three {

	private int data;
	public Three() {}

	public Three(int data) {
		this.data = data;
		// or setData(data);
	}

	public int getData() {
		return data;
	}
	
	public void setData(int data) {
		this.data = data;
	}
	
	public boolean result() {
		if (this.data % 3 == 0)
			return true;

		return false;
	}
	
	
}

'Class > 220728' 카테고리의 다른 글

Class_Overload(1-2)  (0) 2022.07.28
Class_Overload(1-1)  (0) 2022.07.28
Class(2-2)  (0) 2022.07.28
Class(2-1)  (0) 2022.07.28
Class(1-1)  (0) 2022.07.28