Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Write a Program for Beginners  RSS feed

 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is recommended that you not see other answers and try it out yourself.
Write a program using only the File class that creates a file on the hard disk. Do not use any of the stream classes or Writer classes. what happens when you try the code below.

Have fun trying..
------------------
Regds.
Rahul P. Mahindrakar

[This message has been edited by Rahul Mahindrakar (edited August 30, 2000).]
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created this thread so that one could know that creating an Object of File does not create a physical file on the hard disk. This can be done only by invoking the method createNewFile() of File class.
Thus after the code below is executed a file by the name "New" exists on the Hard disk in the same directory in which the program was run.

------------------
Regds.
Rahul P. Mahindrakar
 
srinivas acharyulu
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can u discuss sth more on File class?
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Rahul,
now I'll never forget this concept.
hope u'll keep on giving pearls of knowledge.
thanx again.
regards
deekasha

 
Sandeep Potnis
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rahul.
I've already used this one in the Programming Certification forum.
Keep them coming.
Thanks
Sandeep
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!