Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't able to write in file & Path class not found

 
pradipta kumar rout
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,
I have two problems
1.
I am reading a webpage using URL class and want to write it on a page usin a function. my code as follow



but it is not working can any one tell me what is the problem in this snippet


2.
I am having jdk 6 but unable to use Path class to create a file and to use it.
also Path class api also not found .

I unable to cereate a file by usin Path class

so please help me.

Thank you
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags . It will make your code much easier to read. I can't see what might be wrong though. It would help if you also posted what was not working about it, whether that's a thrown exception, or just no output.

I had actually never heard of the Path class, but with a little research I found that it's being introduced to the java.nio.file package in Java 7. That unfortunately means you can't use it in Java 6.
 
pradipta kumar rout
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir,
my following code creates a file cc.txt but the string is not written there.

kindly rectify the code or suggest me what to do.my above program also create a file but not able to write any string over the file.

Thank you
 
Darryl Burke
Bartender
Posts: 5125
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it really so difficult to UseCodeTags ?

Read the API for BufferedWriter. All of it. It's not that large.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic