We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@JvmField
코틀린 컴파일러가 getter / setter 를 자동으로 생성하지 못하도록 막고, 그 대신 필드를 직접적으로 노출시켜 사용하도록 한다.
예를들어 아래와 같이 location 프로퍼티에만 @JvmField 가 붙은 Corporation 클래스가 있다.
location
Corporation
class Corporation( val name: String, @JvmField val location: String )
이 클래스를 Java 에서 사용하는 경우 각 멤버에 접근할 때 아래와 같이 @JvmField 가 붙은 프로퍼티의 경우 .location 처럼 직접 접근해서 사용할 수 있는 것을 화인할 수 있다.
.location
public static void main(String[] args) { Corporation naver = new Corporation("NAVER", "Seongnam-Si"); String name = naver.getName(); // getXXX() String location = naver.location; // 직접 접근 }
The text was updated successfully, but these errors were encountered:
occidere
No branches or pull requests
@JvmField
코틀린 컴파일러가 getter / setter 를 자동으로 생성하지 못하도록 막고, 그 대신 필드를 직접적으로 노출시켜 사용하도록 한다.
Example
예를들어 아래와 같이
location
프로퍼티에만@JvmField
가 붙은Corporation
클래스가 있다.이 클래스를 Java 에서 사용하는 경우 각 멤버에 접근할 때 아래와 같이
@JvmField
가 붙은 프로퍼티의 경우.location
처럼 직접 접근해서 사용할 수 있는 것을 화인할 수 있다.참고
The text was updated successfully, but these errors were encountered: