aspose file tools*
The moose likes Beginning Java and the fly likes Char Array Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Char Array Problem" Watch "Char Array Problem" New topic
Author

Char Array Problem

Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 131

Hi Everyone!!!
I was trying arrays. When I tried



this, the output was ABC; not the memory address of array object.

but if the array is byte, short, int, long, float, double, boolean it shows the memory address or array object as it should.

I need to know why CharArray program represent values of the array instead for it's memory address?

Regards!!!


Are you better than me? Then please show me my mistakes..
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13880
    
  10

I'll give you some hints to help you figure this out yourself.

1. What type of object is System.out? (Look it up in the API documentation of class java.lang.System).
2. Look at the API documentation of that class; lookup the println() method.
3. What did you find when you looked up the println() method? Can you now answer your own question?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 131

Thanks!!!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36514
    
  16
I presume you have the answer now?
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 131

Campbell Ritchie wrote:I presume you have the answer now?


yep. Thanks for the posts guys!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Char Array Problem
 
Similar Threads
how do you convert CHAR TO STRING
Failed to copy two dimensional array
System.out.println(char[] x);
string reverse O(N) or O(N/2)
toString() of a char array