• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Well THAT's new! Comfort me, reliable tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic