생활 코딩강의로 클래스, 메소드 이해하기
class Calculator{ int left, right; public void setOprands(int left, int right){ this.left = left; this.right = right; } public void sum(){ System.out.println(this.left+this.right); } public void avg(){ System.out.println((this.left+this.right)/2); } } public class Class4 { public static void main(String[] args) { // TODO Auto-generated method stub Calculator c1 = new Calculator(); c1.setOprands(..
2021.11.30