16
Discussion 8 10/30 and 11/1

Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Discussion 810/30 and 11/1

Page 2: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

OOP - Revision to Rectangles

Page 3: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Conversion of Rectangle to Class

Page 4: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Duck Typing: Is there a difference between them?

Page 5: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 1Creates classes C1 and C2 such that

Outputs:

2

6

8

Page 6: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 1

Page 7: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 2What will the output be?

Page 8: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 2What will the output be?

10

10

Page 9: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 3What does this output?

Page 10: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Exercise 3What does this output?

0

0

Page 11: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Streams

Page 12: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Streams

Page 13: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Binary Tree to Stream

How can we convert to stream?

Page 14: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

treeStream (or fringeStream in the notes)

Page 15: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

Linked List to StreamCode for linked list

How can we convert this to a stream?

Page 16: Discussion 8 - GitHub Pages · 2020-01-10 · Linked List to Stream Code for linked list How can we convert this to a stream?

llStream