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: 133

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: 14352
    
  22

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 8 API documentation
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

Thanks!!!
Campbell Ritchie
Sheriff

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

Joined: Oct 26, 2012
Posts: 133

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


yep. Thanks for the posts guys!!
 
 
subject: Char Array Problem