728x90 자바 멤버변수1 [JAVA] ch07-08. 객체 지향 8 public class Ex08 { public static void main(String[] args){ Paper paper = new Paper(10, "HEART"); //paper.NUMBER = 5; System.out.println(paper.NUMBER); System.out.println(paper.KIND); } } //public 메서드호출 //private 멤버변수 class Paper{ final int NUMBER; final String KIND; static int width = 100; static int height = 250; Paper(){ this(1,"HEART"); } Paper(int number, String kind){ this.NUMBER = number;.. JAVA/예제 2017. 8. 22. 이전 1 다음 728x90