Strings


C++ supports strings in two ways. The first way is the C convention of using a null- terminated character array. The second is by using the String class. Java defines a String class that encapsulates a sequence of Unicode characters . The String class defines a wide variety of methods that can be used to create, modify, and manipulate strings. A Java String is by definition an object rather than an array of characters. Both Java and C++ use the + operator to concatenate two strings. The C++ language does not fully support all Unicode characters. A char in C++ is 1 byte. In Java, a char is 2 bytes, meaning that a Java char can represent any Unicode character.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net