• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Swing and Properties file

 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can anybody explain what this code is doing?
 
Tim Moores
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting; does the post serve a particular purpose?
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.....I just want to get meaning of this code
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags next time. It makes it easier to read your code.

It appears that this code replaces lines of a file that contain a specific sub string. Because modifying files on the fly is very tricky it uses an intermediate temporary file to write to first, which then overwrites the original file.
 
Aggarwal Arpit
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Rob,
Can you explain while loop once more?..........Why we are checking the indexOf(stringToCheck)?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Why we are checking the indexOf(stringToCheck)?

did you read the apidocs for String to see what is returned?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic