• Post Reply Bookmark Topic Watch Topic
  • New Topic

Junk output when printing String[]  RSS feed

 
sakthi vandhana
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Can anyone help me figuring out what is wrong in the following code? I am getting junk output.





output
-------

[Ljava.lang.String;@1a46e30
[Ljava.lang.String;@3e25a5



Thanks in advance
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sakthi vandhana, since your question isn't the same as the one posed in the thread you posted it to, I've moved it to its own thread.

What you see is what is returned from the toString() method of the array. To see the contents of the array instead, here are two options: invoke the appropriate method of the java.util.Arrays class OR iterate over the array in a loop and print each element.
 
sakthi vandhana
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Darryl. I got it.
 
sakthi vandhana
Greenhorn
Posts: 9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sakthi vandhana wrote:Thanks Darryl. I got it.


 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!