• 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
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Sun Guoqiao's Mock Exam doubt

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between the File and
RandomAccessFile classes?
(Select three correct answers)
A: The File class encapsulates the files and directories of the local file system.
B: The File and RandomAccessFile can be chained together in order to manipulate some files.
C: The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.
D: The File deals with byte while RandomAccessFile deals with char of the target file.
I did not understand how point A (that was a prt of the answer) could be the difference between File and RandomAccessFile classes???
Both of them encapsulates the files and directories of the local file system, nah ???
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Both of them encapsulates the files and directories of the local file system, nah ???


RandomAcessFile's constructors will throw FileNotFoundException if the argument passed in is a directory.

Also the phrase is not very accurate. "encapsulates" seems to refer to the fact that an object holds a field of another object, controlling access to it. A better word is "abstracts". I would say: A File object represents an abstraction of a file or directory pathname. And It does so in a machine independent way.
Regarding RandomAccessFile abstracts nothing. Its purpose is to access the content of a file not sequentially. However File does not deal with contents at all.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The structure of the question is also somewhat
suspect - picking 3 out 4 correct. You get
a 25% chance of being correct by random
selection.
Questions that have 3 correct answer choices
will typically have a larger answer selection
list ( at least 5, typically 6 or more ).
-----------------------------------
Considering the Certified Java Programmer Exam?
Get JCertify!
The best investment in your career you will make all year
http://www.enterprisedeveloper.com/jcertify
Exams and integrated content for 310-025 and 310-035
 
Preety Narashimhan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yeh was kinda confused with the wordings ...
Thanks a lot folks even the site turned out to be helpful !!!
 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you give me the URL?
 
Preety Narashimhan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the URL
www.jiris.com/mockexam
all the 3 mock exams ..
reply
    Bookmark Topic Watch Topic
  • New Topic