Files and Exceptions Flashcards
What does the cd command do in the shell?
Change Directory
Explain this permission
-rw-r–r–
Read/write for the user, read for the group and others
Talking about files not a directory
Explain this permission
-rwxr-x—
Read/Write/Execute for the user, read for the group and execute for others
Talking about files not a directory
Explain this permission
dr-xr-xr-x
Talking about a directory
Execute/Read for the user and group and just execute for the others
What is an exception?
An event, which occurs during the execution of a program that disrupts the normal flow of the program’s instructions
What is an error?
Indicates a serious problem that a reasonable application should not try to catch
What is the difference between an exception and an error?
Try to catch an exception, don’t try to catch an error
Why does Java allow unchecked exceptions?
Wanted to have unchecked exceptions that should be used when calling code cannot recover
What is the purpose of a finally block?
Used to execute important code such as a closing connection because always executed whether an exception is handled or not
Give the disadvantages of files over relational databases
- Data redundancy and inconsistency
- Difficulty in accessing data
- Integrity problems
- Security problems
- Atomicity of updates
- Concurrent access
Give the advantages of files over relational databases
Cheaper
Doesn’t require special knowledge