Last active
September 14, 2019 13:55
-
-
Save youngjinmo/0ba974c2f18d7f7c8baae9d3c4bf1d22 to your computer and use it in GitHub Desktop.
char형으로 형변환하는 방법
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class toChar { | |
public static void main(String[] args){ | |
int a = 66; | |
double b = 3.456; | |
String c = "90"; | |
char d = 'd'; | |
System.out.println("Integer to char : " + (char)a); | |
// Integer to char : B | |
System.out.println("String to char : " + c.charAt(0)+", "+c.charAt(1)); | |
// String to char : 9, 0 | |
System.out.println("String to char Array : " + Arrays.toString(c.toCharArray())); | |
// String to char Array : [9, 0] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment