Created
May 6, 2016 08:00
-
-
Save josephkandi/6eaedcc14a5deb8bdcc354db83cf1984 to your computer and use it in GitHub Desktop.
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
class CharDemo { | |
public static void main (String[] args) { | |
//The char data type is represented internally as a number | |
//It holds a single unicode character | |
char correctAnserOption = 'A'; | |
//The unicode value for the @ sign is 64. | |
char atSign = 64; | |
System.out.println(atSign); | |
//You can also use it to display non-printable characters | |
//You use a backslash to represent non-printable characters | |
//Here is a tab key | |
char tab = '\t'; | |
System.out.println("Hello" + tab + "There"); | |
//TODO | |
//Try adding a newline instead of a tab between Hello and There | |
//HINT - The newline character is represented by n | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment