Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Char Array  RSS feed

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


output:
here nothing is printed.


please explain the output??

as i know that primitive arrays are given default value.

but even when the array declarations are made outside the main
method output remain the same "nothing is displayed".
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Try System.out.println("-"+y+"-");
Array element always get default values.
Default char is '\u0000', invisibel, but you can see it occupies
a character position between the two "-".
Regards,
Teo
[ October 15, 2007: Message edited by: Teo Framoe ]
 
Hold that thought. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!