System.out.println("hello world".getBytes("UTF-8"));
occasionally returns a different value, why is that??
Sorry, I’m still a noob at Java.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This code prints an array (byte[]), but there is no standard array printing in Java. So instead of printing the content of the array, the code displays some cryptic memory reference to the array. Eg “[B@6bbc4459”. This information is not very useful and is likely to change between programm executions.
If you want to display the content of the array, you must iterate through it.