• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

printing default value of char

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

why it doesnt print anything?? but if i put the line //1 in the last then it prints y???
regards
Loveleen
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
What i came to find out that its printing the default value of char
when i run the code with this




i got the following output

false
null
0
0.0



i got the following output
false
null
0
0.0



the difference is that it prints the space which remains unidentified,in the first code before 'false' and in the second after '0.0'
 
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

It is not printing anythin may be because the default value of char that is '\u0000' is not printable.

but if i put the line //1 in the last then it prints y???


for me it did not printed anything both in the last as well as in the first
it just prints a single space at both the places that's it.

Sandy
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I modified the code so that we can see wat the output is


output:
. .
false
null
0
0.0
. .

Sandy
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Various output "devices" print the character with value 0 in different ways. Some print nothing, some print some "funny" symbol indicating that they can't print a proper character. "Devices" include things like Windows command console windows and xterm windows as well as laser printers, teletypes, matrix printers, etc.
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Loveleen ..

iam using Jdev.when i executed the code its printing a symbol which represents like this []...in the first as well last instead of blank space as suggesting by our frnds .

why so??

thanks
srikanth
 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by srikanth reddy:
hi Loveleen ..

iam using Jdev.when i executed the code its printing a symbol which represents like this []...in the first as well last instead of blank space as suggesting by our frnds .

why so??

thanks
srikanth



as Barry said...

Various output "devices" print the character with value 0 in different ways. Some print nothing, some print some "funny" symbol indicating that they can't print a proper character. "Devices" include things like Windows command console windows and xterm windows as well as laser printers, teletypes, matrix printers, etc.



this is the reason you are getting symbol.

Sandy
 
reply
    Bookmark Topic Watch Topic
  • New Topic