This topic contains a solution. Click here to go to the answer

Author Question: What does the following code do?FileInputStream fis = new FileInputStream("test.dat"); (Read 56 times)

dbose

  • Hero Member
  • *****
  • Posts: 597

Question 1

To append data to an existing file, use ________ to construct a FileOutputStream for file out.dat.
◦ new FileOutputStream("out.dat", true)
◦ new FileOutputStream(true, "out.dat")
◦ new FileOutputStream("out.dat", false)
◦ new FileOutputStream("out.dat")

Question 2

What does the following code do?

FileInputStream fis = new FileInputStream("test.dat");

◦ It creates a new file named test.dat if it does not exist and opens the file so you can write to it.
◦ It creates a new file named test.dat regardless of whether it exists or not and opens the file so you can write to it and read from it.
◦ It creates a new file named test.dat if it does not exist and opens the file so you can write to it and read from it.
◦ It creates a new file named test.dat regardless of whether it exists or not and opens the file so you can write to it.
◦ It creates a FileInputStream for test.dat if test.dat exists.


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by dbose on May 6, 2020

Silverbeard98

  • Sr. Member
  • ****
  • Posts: 355
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




dbose

  • Member
  • Posts: 597
Reply 2 on: May 6, 2020
YES! Correct, THANKS for helping me on my review


bitingbit

  • Member
  • Posts: 323
Reply 3 on: Yesterday
Great answer, keep it coming :)

 

Did you know?

Street names for barbiturates include reds, red devils, yellow jackets, blue heavens, Christmas trees, and rainbows. They are commonly referred to as downers.

Did you know?

Nearly all drugs pass into human breast milk. How often a drug is taken influences the amount of drug that will pass into the milk. Medications taken 30 to 60 minutes before breastfeeding are likely to be at peak blood levels when the baby is nursing.

Did you know?

ACTH levels are normally highest in the early morning (between 6 and 8 A.M.) and lowest in the evening (between 6 and 11 P.M.). Therefore, a doctor who suspects abnormal levels looks for low ACTH in the morning and high ACTH in the evening.

Did you know?

There are major differences in the metabolism of morphine and the illegal drug heroin. Morphine mostly produces its CNS effects through m-receptors, and at k- and d-receptors. Heroin has a slight affinity for opiate receptors. Most of its actions are due to metabolism to active metabolites (6-acetylmorphine, morphine, and morphine-6-glucuronide).

Did you know?

Complications of influenza include: bacterial pneumonia, ear and sinus infections, dehydration, and worsening of chronic conditions such as asthma, congestive heart failure, or diabetes.

For a complete list of videos, visit our video library