• 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

also about file class

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i dont know why the answer is e?
File f = new File("hello.txt");
FileOutputStream out = new FileOutputStream(f);
Select the one right answer.
[a] Create a new file named "hello.txt" if it does not yet exist. It also opens the file so you can write to it and read from it.
[b] Create a new file named "hello.txt" if it does not yet exist.The file is not opened.
[c] Open a file named "hello.txt" so that you can write to it and read from it, but does not create the file if it does not yet exist.
[d] Open a file named "hello.txt" so that you can write to it but cannot read from it.
[e] Create an object that you can now use to create and open the file named "hello.txt" and write to and read from the file.
Answer 11
[e] Create an object that you can now use to create and open the file named "hello.txt," and write to and read from the file.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer is not e its d. This topic has already been discussed.
Follow the below link http://www.javaranch.com/maha/Discussions/java_io_Package/Boone__38__File_I-O_-_JavaRanch_Big_Moose_Saloon.htm
 
Ranch Hand
Posts: 1246
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Agree!!! Its D.
You have a outputstream.. u can't read from that.
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with 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