default

국비 지원/JAVA

[JAVA] 접근 제한자

접근 제한자 종류 1) public : 외부 클래스가 자유롭게 사용할 수 있다. package practice.ex1; public class PublicEx { public int a = 10; } package practice.ex1;// 같은 패키지 public class Test { public static void main(String[] args) { PublicEx publicEx = new PublicEx(); System.out.println(publicEx.a);// 출력 가능 } } package practice.ex2;// 다른 패키지 import practice.ex1.PublicEx; public class Test { public static void main(String[] ..

아민_
'default' 태그의 글 목록