• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

a scjp question.

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A directory can be created using a method from the class(es):
a) File
b) DataOutput
c) Directory
d) FileDescriptor
e) FileOutputStream

the given ans :a
i fill the ans line with :c
but i thought the class File has no effect on system.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure it does! The point to remember about the File class is that it does not create a new file when the constructor is called. Plus, there's no Directory class.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gong,
There is no directory class, and u can create a directory using File class but u can't change a directory ie. wandering btw directories.
Althoug Michael i think u can create a file using File class. In the following way -:
File f = new File();
f.createNewFile();
Correct me if i am wrong.
 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
File Class does able to create file, it just cannot manipulate the content of created file though.
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try mkdir() and mkdirs()

HTH
tvs
Sun Certified Programmer for Java2 Platform
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic