This post originated from an RSS feed registered with Java Buzz
by News Manager.
Original Post: When is a Character Not a Character?
Feed Title: JavaWorld
Feed URL: http://www.javaworld.com/index.rss
Feed Description: JavaWorld.com: Fueling Innovation
Just when you thought you knew everything there is to know about the Java language, along comes something new to challenge your sense of complete mastery. For example, did you know that Java lets you declare a class within an interface, as in interface A { class B {} }? Also, were you aware that you can "add" cast operators together in an assignment statement such as byte i = (byte) + (short) + (double) 2000;? (You're not really adding cast operators.) Neither of these oddities is the subject of this post. Instead, I'm going to show you that not every value that can be assigned to a char variable denotes a character.