| Author |
printing default value of char
|
Loveleen Saroya
Ranch Hand
Joined: Aug 08, 2005
Posts: 42
|
|
why it doesnt print anything?? but if i put the line //1 in the last then it prints y??? regards Loveleen
|
 |
anand phulwani
Ranch Hand
Joined: Sep 10, 2005
Posts: 242
|
|
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'
|
Thanks and Regards, Anand
SCJP 5.0 310-055 73%, SCWCD 1.4 310-081 78%, IBM DB2 9 Fundamentals 000-730 62%
|
 |
Sandeep Chhabra
Ranch Hand
Joined: Aug 28, 2005
Posts: 340
|
|
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
|
Regards<br />Sandy<br />[SCJP 5.0 - 75%]<br />[SCWCD 1.4 - 85%]<br />------------------<br />Tiger, Tiger burning bright,<br />Like a geek who works all night,<br />What new-fangled bit or byte,<br />Could ease the hacker's weary plight?
|
 |
Sandeep Chhabra
Ranch Hand
Joined: Aug 28, 2005
Posts: 340
|
|
I modified the code so that we can see wat the output is output: . . false null 0 0.0 . . Sandy
|
 |
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
|
|
|
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.
|
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
|
 |
srikanth reddy
Ranch Hand
Joined: Jul 28, 2005
Posts: 252
|
|
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
|
Thanks & Regards<br /> <br />-Srikanth
|
 |
Sandeep Chhabra
Ranch Hand
Joined: Aug 28, 2005
Posts: 340
|
|
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
|
 |
 |
|
|
subject: printing default value of char
|
|
|