The Artima Developer Community
Sponsored Link

Java Buzz Forum
On bytes, chars, Strings, XML and Unicode

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Arjen Poutsma

Posts: 168
Nickname: poutsma
Registered: Sep, 2003

Arjen Poutsma is senior software engineer for JTeam
On bytes, chars, Strings, XML and Unicode Posted: May 15, 2008 10:21 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Arjen Poutsma.
Original Post: On bytes, chars, Strings, XML and Unicode
Feed Title: The Ancient Art of Programming
Feed URL: http://feeds.feedburner.com/TheAncientArtOfProgramming
Feed Description: A blog about programming in .NET and Java
Latest Java Buzz Posts
Latest Java Buzz Posts by Arjen Poutsma
Latest Posts From The Ancient Art of Programming

Advertisement

Strings

What does this print?

byte[] buf = new byte[]{'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd'}; String s = new String(buf); System.out.println(s);

Obviously, the answer is the infamous “Hello World”. Unless you live in China or Japan. More about that later.

Let’s make it a bit more exiting:

byte[] buf = new byte[]{'H', (byte) 0xEB, 'l', 'l', [...]

Read: On bytes, chars, Strings, XML and Unicode

Topic: April 2008 New Java Performance Tips Previous Topic   Next Topic Topic: StartUp Engineering-SocialChicaogoExperiment

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use