Sunday, June 30, 2013

Display smiley face character in Java

Example to display smiley face character (☺) in Java:

Display smiley face character in Java
Display smiley face character in Java


package javaex_smileyface;

/**
* @web http://java-buddy.blogspot.com/
*/
public class JavaEx_SmileyFace {

public static void main(String[] args) {
System.out.println('\u263A');
System.out.println('☺');
}
}


remark: Not all Operating Systems can display extended Unicode symbols, regardless of bundling the fonts with the programs. If it can't display the Unicode symbol, it displays a Square instead.

No comments:

Post a Comment