Java 배우기145 Summary of Creating and Using Packages Summary of Creating and Using PackagesTo create a package for a type, put a package statement as the first statement in the source file that contains the type (class, interface, enumeration, or annotation type).To use a public type that's in a different package, you have three choices: (1) use the fully qualified name of the type, (2) import the type, or (3) import the entire package of which th.. 2016. 1. 24. Managing Source and Class Files 소스 및 클래스 파일 관리하기 소스 및 클래스 파일 관리하기 Managing Source and Class Files 자바 언어 규격이 요구하고 있지 않지만, 많은 자바 플랫폼의 구현은 소스와 클래스 파일을 관리하기 위한 계층적 파일 시스템에 의존하고 있습니다. 전략은 다음과 같습니다.이름이 타입의 간단한 이름이고 그 확장자가 .java 인, 텍스트 파일 안의 클래스, 인터페이스, 열거, 또는 주석 타입에 소스 코드를 넣으십시오. 예를 들면: Many implementations of the Java platform rely on hierarchical file systems to manage source and class files, although The Java Language Specification does not requi.. 2016. 1. 24. Using Package Members Using Package MembersThe types that comprise a package are known as the package members.To use a public package member from outside its package, you must do one of the following:Refer to the member by its fully qualified nameImport the package memberImport the member's entire packageEach is appropriate for different situations, as explained in the sections that follow.Referring to a Package Memb.. 2016. 1. 24. Naming a Package 패키지 이름짓기 패키지 이름짓기 Naming a Package 자바 프로그래밍 언어를 사용해서 클래스와 인터페이스를 작성하는 전세계의 프로그래머들은, 서로 다른 타입에 대하여 동일한 이름을 사용할 가능성이 높습니다. 사실, 앞의 예는 그렇게 하고 있습니다: java.awt 패키지 안에 Rectangle 클래스가 이미 있는데도 앞의 예는 Rectangle 클래스를 정의하고 있습니다. 하지만 컴파일러는 클래스들이 서로 다른 패키지에 있는 경우, 두 클래스는 같은 이름을 가질 수 있습니다. 각각의 Rectangle 클래스의 완전한 이름에는 패키지 이름이 포함됩니다. 즉, graphics 패키지의 Rectangle 클래스의 완전한 이름은 graphics.Rectangle 이고, java.awt 패키지에 있는 Rectangle .. 2016. 1. 24. Creating a Package 패키지 만들기 패키지 만들기 Creating a Package 패키지를 만들려면, 패키지의 이름을 선택한 다음 (이름짓기 규칙은 다음 섹션에서 설명), 패키지에 넣고자 하는 타입 (클래스, 인터페이스, 열거enumerations 및 주석 타입)이 포함된 모든 소스 파일의 상단에 해당 이름을 가진 패키지 문을 넣습니다. , 패키지 문 (예, 패키지 그래픽)은 소스 파일의 첫 줄이어야 합니다. 각 소스 파일에는 1개의 패키지 문만 있을 수 있으며, 그것은 파일의 모든 타입에 적용됩니다. To create a package, you choose a name for the package (naming conventions are discussed in the next section) and put a package state.. 2016. 1. 24. Creating and Using Packages 패키지 만들기와 사용하기 패키지 만들기와 사용하기 Creating and Using Packages 프로그래머들은, 타입들을 보다 쉽게 찾고 사용하게 하기 위하여, 이름 짓기에서 혼동이 안생기도록 하기 위하여, 관련 있는 타입들의 그룹들을 패키지로 묶습니다. To make types easier to find and use, to avoid naming conflicts, and to control access, programmers bundle groups of related types into packages.정의: package는 access protection 및 name space 관리를 제공하는, 관련된 타입들의 그루핑입니다. types은 classes, interfaces, enumerations 및 annotati.. 2016. 1. 24. 이전 1 2 3 4 5 ··· 25 다음