Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTony Brackins
28,766 Points[SOLVED] toCharArray()
String example = "Hello";
System.out.println("This is example as an array " + example.toCharArray());
result is String example = "Hello";
This is example as an array [C@7852e922
Anyone know what's going on?
1 Answer
Tony Brackins
28,766 PointsWas able to figure this one out: http://stackoverflow.com/questions/409784/whats-the-simplest-way-to-print-a-java-array
Robert Richey
Courses Plus Student 16,352 PointsAnother way, not shown in that post, is to call String.valueOf(example).
System.out.println("Example as an array " + String.valueOf(example));
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsEdited for solved