Exam 2 Review Flashcards

1
Q

Why do we use the Software Development Life Cycle?

A

It allows for more efficiency in the coding process

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

Difference between functional and nun-functional requirements

A

Functional: deals with inputs/outputs/behaviors

Nonfunctional: everything else (language… whatever)

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

The sooner you catch a mistake, the cheaper it is. (T/F)

A

True

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

Polymorphism

A

a feature of java that allows a method to be selected at runtime… enables inheritances/interfaces

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

How do you write a comparable interface? What is required?

A

the class must ‘implements Comparable’

there must be a x.compareTo(y) method

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

How to write a comparator interface?

A

implements Comparator

includes a compare(x,y) method

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

Substitutability Principle

A

child can be substituted for anywhere a parent can go

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

Stacks order?

A

LIFO

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

Queues order?

A

FIFO

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

What is necessary for a binary search?

A

A sorted array!!!!

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

Generally accepted phases of the Software Development Life Cycle..

A

Requirements, Design, Implementation and Testing, Maintenance

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

Can interfaces be instantiated?

A

No

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

Can an interface implement a method? If so, how?

A

Yes, using the default keyword

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

Interfaces have a constructor (T/F)

A

False

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

Classes implement an interface (T/F)

A

True

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

Classes can only have one parent class but can implement many interfaces (t/f)

A

True

17
Q

Comparable interface defines the natural order for a class…(t/f)

A

True

18
Q

Comparator interface defines a total ordering based on what ur looking for (t/f)

A

True

19
Q

Abstract classes can be instantiated (t/f)

A

False

20
Q

Can abstract classes provide an implementation for methods?

A

Yes

21
Q

What are benefits of an abstract class?

A

It’s very easy to define variables/methods/constructors for classes to use this abstract classes.

22
Q

Pop() vs peek()

A

Pop() = removes and returns the top

Peek() only looks at the top

23
Q

Errors and Exceptions inherit from

A

Throwable

24
Q

Exceptions are short for

A

Exceptional Events

25
Q

3 types of exceptions and the difference between them?

A

Errors: “unpreventable”

Unchecked Exceptions:
“programmer mistakes”

Checked Exceptions: “anticipated potential problems”