aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Transient /File Class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Transient /File Class" Watch "Transient /File Class" New topic
Author

Transient /File Class

Shailendra Bade
Greenhorn

Joined: Jul 04, 2000
Posts: 22

Is it possible to create a physical file using
File Class. According to Barry Boone, it is possible
in Java 2 . Roberts/Heller do not mention any method for
this.
Also both books say that a transient variable cannot
be static and final but this compiles fine.
Shailendra Bade

Shailendra Bade<BR>Mumbai, India<BR>Mail to: bades@vsnl.com
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Java 1.2 adds the static createTempFile methods (not instance methods, static), and the createNewFile method (an instance method).
The purpose of the transient modifier is to label variables that should not be serialized.
Bill
satish
Greenhorn

Joined: Jul 03, 2000
Posts: 27
Regarding transient variable, refer to RHE errata


satish
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
It sure is possible to create a physical file using the File class.
File newFile = new File("newFile.txt");
will give you the handle newFile for a file that is very much physical.
carl
rajsim
Ranch Hand

Joined: May 31, 2000
Posts: 116
The statement
File newFile = new File("newFile.txt");
doesn't create a new physical file. It just creates a new
instance of File class.
 
wood burning stoves
 
subject: Transient /File Class