• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need one explanation for Input Stream  RSS feed

 
Saket Kumar Sinha
Ranch Hand
Posts: 32
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,

I have written one demo class for learning properly the packages in java.io package.


Now when i enter name SAKET

Enter your name :
Saket
Number of characters entered is 7

Why it should not be 5?
is it because of '/0'(as in C language) thing and carriage return making it 7 ?
Please anyone explain.
Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can investigate that on your own by printing out each character code individually.
 
Saket Kumar Sinha
Ranch Hand
Posts: 32
Eclipse IDE Java Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya i figured it out. It's LF(Line Feed) and CR(carriage Return)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!