Files and Exceptions Flashcards

1
Q

What does the cd command do in the shell?

A

Change Directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain this permission

-rw-r–r–

A

Read/write for the user, read for the group and others

Talking about files not a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain this permission

-rwxr-x—

A

Read/Write/Execute for the user, read for the group and execute for others
Talking about files not a directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain this permission

dr-xr-xr-x

A

Talking about a directory

Execute/Read for the user and group and just execute for the others

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an exception?

A

An event, which occurs during the execution of a program that disrupts the normal flow of the program’s instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is an error?

A

Indicates a serious problem that a reasonable application should not try to catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between an exception and an error?

A

Try to catch an exception, don’t try to catch an error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why does Java allow unchecked exceptions?

A

Wanted to have unchecked exceptions that should be used when calling code cannot recover

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of a finally block?

A

Used to execute important code such as a closing connection because always executed whether an exception is handled or not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Give the disadvantages of files over relational databases

A
  • Data redundancy and inconsistency
  • Difficulty in accessing data
  • Integrity problems
  • Security problems
  • Atomicity of updates
  • Concurrent access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Give the advantages of files over relational databases

A

Cheaper

Doesn’t require special knowledge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly