Java ord()

Jmnote (토론 | 기여)님의 2023년 2월 13일 (월) 18:52 판 (새 문서: ==개요== ;Java ord() <syntaxhighlight lang='java' run> class App { public static void main(String args[]) { System.out.println( (int) 'a' ); // 97 System.out.p...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

Java ord()
class App {
    public static void main(String args[]) {
        System.out.println( (int) 'a' );  // 97
        System.out.println( (int) '가' ); // 44032
        System.out.println( (int) '👍' ); // 55357  ❌
    }
}
class App {
    public static void main(String args[]) {
        System.out.println( "a".codePointAt(0) );  // 97
        System.out.println( "가".codePointAt(0) ); // 44032
        System.out.println( "👍".codePointAt(0) ); // 128077
    }
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}