hello quizlet
Home
Subjects
Expert solutions
Create
Study sets, textbooks, questions
Log in
Sign up
Upgrade to remove ads
Only $35.99/year
EX2: WK8 Object Oriented Programming
Flashcards
Learn
Test
Match
Flashcards
Learn
Test
Match
Terms in this set (25)
Volatile storage
- Computer memory or random access memory (RAM) - Temporary
Nonvolatile storage
- Not lost when computer loses power - Permanent
Computer file
- Collection of information stored on nonvolatile device in computer system
Permanent storage devices
- Hard disks - Zip disks - USB drives - Reels or cassettes of magnetic tape - Compact discs
Categories of files by the way they store data
- Text files
- Binary files
Data files
Contain facts and figures
Program files or application files
- Store software instructions
Path
- A complete list of disk drive plus the hierarchy of directories in which a file resides
Path class
- Use it to createobjects that contain information about files or directories, such as their locations, sizes, creation dates and whether they even exist
Files class
- Use it to perform operations on files and directories, such as deleting them, determining their attributes, and creating input and output streams
java.nio.file package
- Include it to use both the Path and Files classes - import java.nio.file.*; - nio stands for new input/output
String toString()
Returns the String representation of the Path, eliminating double backslashes
Path getFileName()
Returns the file or directory denoted by this Path; this is the last item in the sequence of name elements
int getNameCount()
Returns the number of name elements in the Path
Path getName(int)
Returns the name in the position of the Path specified by the integer parameter
Deleting a Path
The Files class delete() method accepts a Path parameter and deletes the last element (file or directory) in a path or throws an exception if the deletion fails. • If you try and delete a file that does not exist, a NoSuchFileException is thrown • A directory cannot be deleted unless it is empty. If you try to delete a directory that contains files, a DirectoryNotEmptyException is thrown • If you try to delete a file but you don't have a permission, a SecurityException is thrown
Businesses store data in hierarchy
- Character
- Field
- Record
- Files
Sequential access file
- Each record is stored in order based on value in some field
Open a file
- Create object - Associate a stream of bytes with it
Close the file
- Make it no longer available to your application - You should always X you open
Stream
is an object, with data and methods (pipeline or channel) - Bytes flow into your program from an input device - Bytes flow out of your application to an output device - Most streams flow in only one direction - methods allow you to open, close, read, write
Buffer
- Memory location where bytes are held after they are logically output, but before they are sent to the output device - Using a X improves program performance as input and output operations are usually the slowest in any computerized system because of limitations imposed by the hardware.
Flushing
- Clears any bytes that have been sent to a buffer for output, but have not yet been output to a hardware device
Writing to a File
Assign file to the OutputStream - Construct a BufferedOutputStream object - Assign it to the OutputStream ■ Create a writeable file by using the Path class newOutputStream() method - Creates a file if it does not already exist - Opens the file for writing and returns an OutputStream that can be used to write bytes to the file
BufferedWriter class
- Counterpart to BufferedReader
- Writes text to an output stream, buffering the characters
- The class has three overloaded write() methods that provide for efficient writing of characters, arrays, and strings, respectively
Sets found in the same folder
EX2: WK5 Object Oriented Programming
24 terms
EX2: WK7 Object Oriented Programming
25 terms
EX2: WK6 Object Oriented Programming
21 terms
EX1: WK1 Programming Basics
23 terms
Other sets by this creator
EX1: WK4 Object Oriented Programming
15 terms
EX1: WK3 Object Oriented Programming
17 terms
EX1: WK2 Object Oriented Programming
34 terms
EX2 Ch 14 Installation & Operations
7 terms
Verified questions
engineering
Radium 224/88Ra has a half-life of about 3.6 days. (a)Given 1 gram, how much will still be present after 1 day? (b)After 1 year?
engineering
Various techniques have been proposed to curb cross-border drug smuggling into a country. The costs of implementing each strategy along a particularly rugged section of the border are indicated below. The table also includes a score that is compiled based on deterrence, interdiction, and apprehension, with a higher score indicating better performance. For a budget of $60 million, determine which techniques should be employed on the basis of a cost-effectiveness analysis.$ $$ \begin{array}{lcc} \text { Activity } & \text { cost, } \$ \text { Millions } & \text { Score } \\ \hline \text { Tethered aerostats } & 3.8 & 8 \\ \text { Boots-on-the-ground } & 31.4 & 52 \\ \text { Fence } & 18.7 & 12 \\ \text { Motion sensors } & 9.8 & 7 \\ \text { Seismic sensors } & 8.3 & 5 \\ \text { Drones } & 12.1 & 26 \\ \hline \end{array} $$ $
physics
A proton has a velocity of $1.0 \times 10^2 \mathrm{~m} / \mathrm{s} \hat{i}+2.0 \times$ $10^2 \mathrm{~m} / \mathrm{s} \hat{j}$ and is located in the $z=0$ plane at $x=3.0 \mathrm{~m}, y=4.0 \mathrm{~m}$ at some time $t=T$. Determine the magnetic field in the $z=0$ plane at $x=3.0 \mathrm{~m}, y=6.0 \mathrm{~m}$.
physics
What is the speed of waves on this rope?
Recommended textbook solutions
Information Technology Project Management: Providing Measurable Organizational Value
5th Edition
Jack T. Marchewka
346 solutions
Operating System Concepts
9th Edition
Abraham Silberschatz, Greg Gagne, Peter B. Galvin
489 solutions
Service Management: Operations, Strategy, and Information Technology
7th Edition
James Fitzsimmons, Mona Fitzsimmons
103 solutions
Computer Organization and Design MIPS Edition: The Hardware/Software Interface
5th Edition
David A. Patterson, John L. Hennessy
220 solutions
Other Quizlet sets
Teams Week 1
20 terms
A&P 2 Test 2 "Lymph & Immune"
134 terms
MCB test 2 questions
50 terms
ECON 2030 Exam 2 (Roussel)
76 terms