Lecture 17 - Advanced Java Flashcards

1
Q

Advantages of Functional Programming

A

Easier to run things in parallel. Can be more concise and readable. Can make code more flexible and powerful. Can be easier to test.

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

Creating a stream from a source

A

From individual values, from an array, from a collection, from a range, from the lines in a file or an infinite stream.

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

Properties of Streams

A

Can define infinite stream, can execute them in parallel or in serial, streams can only be traversed once, stick to pure functions.

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

Lambda Functions

A

These functions should avoid state and mutable data (Variables that change their values). They should always produce the same output for a given input.

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