fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // -----| input |----------------
  13. String input = "😷" ; // FACE WITH MEDICAL MASK at code point U+1F637 (decimal: 128,567).
  14. int codePoint = input.codePointAt( 0 ) ; // Returns 128,567.
  15. System.out.println( "codePoint : " + codePoint ) ;
  16.  
  17. // -----| String |----------------
  18. String output = Character.toString( codePoint ) ; // Pass an `int` primitive integer number.
  19. System.out.println( "output : " + output ) ;
  20.  
  21. String output2 = Character.toString( 128_567 ) ; // Pass an integer literal.
  22. System.out.println( "output2 : " + output2 ) ;
  23. }
  24. }
Success #stdin #stdout 0.12s 36028KB
stdin
Standard input is empty
stdout
codePoint : 128567
output : 😷
output2 : 😷