This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how jvm understand that from which point print in newline while coping from file a to b ?

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mine mam told me that with this line we can tell jvm to print on next line , but i think there is something wrong with jvm ..lolz ..jokes apart but tell me whats wrong in this code
my file "a" contents are in single line mine question is , how jvm understands that from which point the text should be printed on a newline ?

what i want in file "b" is
in next line .
but it is giving me output on file 'b' is same as contents of file "a" .


[/code]
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
naved momin wrote: how jvm understands that from which point the text should be printed on a newline ?


The JVM doesn't decide where to put a newline. Your code does that. Do you understand what your code does? Under what circumstances will your code insert a newline into b.txt?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Ess wrote:
naved momin wrote: how jvm understands that from which point the text should be printed on a newline ?


The JVM doesn't decide where to put a newline. Your code does that. Do you understand what your code does? Under what circumstances will your code insert a newline into b.txt?

i didnt , understand i have a long text twice what i want is after every fullstop write in newline .

now this should be in file 'b' like
 
Joe Ess
Bartender
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed your input and output files. They were in one code block, which was confusing.

naved momin wrote:i didnt , understand i have a long text twice what i want is after every fullstop write in newline .


Why didn't your original post mention this requirement? The input file in your original post doesn't have any full stops.
Do you know how to look for a character in a String? Maybe looking through the JavaDoc for java.lang.String will inspire you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic