• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javacaps-mock Q

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
35. The File class is concerned select all the correct answers?

A) A File class can be used to create files and directories
B) A File class has a method mkdir() to create directories
C) A File class has a method mkdirs() to create directory and its parent direcoties.
D) A File cannot be used to create directories.

Answer given:B,C
Answer's according to me :A,B,C
As file class has method....createNewFile() which creates a new empty file.And mkdir() method creates new directory as per the path specfied by current File object.
Please, suggest.
Thanks.
Mukti
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you on this one. File class has methods to create a file, create a single directory (mkdir()) or create multiple directories (mkdirs()).
Bill
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
Here is the correction for this post http://www.javacaps.com/scjp_mockexams2.html#q18
Thanks
Konda Balabbigari
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.javacaps.com/scjp_mockexams2.html#q35
an updated link to the updated question... :-)
 
I think I'll just lie down here for a second. And ponder this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic