자바 클래스(class) static 키워드를 가지는 메소드를 클래스 메소드(static method)라고 한다. static 키워드를 가지지 않는 메소드는 인스턴스 메소드(instance method)라고 한다. class Instance { int a = 10, b = 20; int add() { return a + b; } static int add(int x, int y) { return x + y; } } public class Hour_OF_Day { public static void main(String[] args) { System.out.println(Method.add(20, 30)); Method mymethod = new Method(); System.out.println(mymethod.add()); } .. 매일 그림 그리기 1일차 책 산 김에 블로그에 올려봅니다. 매일 그림 그리기 이전 1 ··· 3 4 5 6 다음