Landing : Athabascau University

Unit 7

Last updated August 1, 2023 - 12:13pm by Trent Shea

Quickly read through Assignment 3 before reading this chapter. Arrays and lists and <T> are not new to me, so I read the chapter quickly, focusing on syntax and methods I expect to use in the upcoming assignments. Looked at the exercises for the chapter and didn’t see anything new to me. The transpose problem would probably be worth doing as an exercise for array practice, but I don’t really feel like juggling today. The rest of the problems look straight forward and similar enough to C# problems I’ve done before, so I’ll skip them too. The read a file and sort display unique words looks fun too, but again something I’ve done, and I’ve even gone as far as frequency analysis of characters, so I’ll skip it.

Section 7.1
Array Details

 

Takeaways

  • Foreach, yay. Looks like a nice syntax for it, too.
  • There’s a warning that the foreach doesn’t modify elements in list, but I wonder what it does with objects that are not the primitives… seems unlikely that the full object is being copied in a foreach loop… what if the list of objects is large bitmap etc…
  • Arity methods are new to me. Seem similar to optional parameters with default values, but I’m sure we’ll get to that. But for now realize arity methods give you an array of the datatype
  • Arity methods also accept array of the datatype
  • Too bad I didn’t’ read ahead to this section when starting assignment 2 problem 5 … oh well.

Mapping Learning Outcomes

Articulate the principles of object-oriented problem solving and programming. Outlines essential features and elements of the Java programming language. Program with basic data structures using array, list, and linked structures.

Section 7.2
Array Processing

Takeaways

  • Out of bounds…
  • I’m surprised to see so much reference to pointers, but it makes sense. I just thought Java didn’t deal with them, I guess it’s more we don’t deal with addresses, not that we escape the concept.
  • Array stuff… basically highlights the dangers of arrays and partial arrays, and copying etc. seems to be building up to the next structure, lists, which should help avoid some pitfalls.
  • Remember this section for array methods.
  • Parallel arrays, dynamic arrays, making copies and hiding the sizing from user.

Mapping Learning Outcomes

Articulate the principles of object-oriented problem solving and programming. Outlines essential features and elements of the Java programming language. Apply concepts of class, method, constructor… more info on basic data structure array.

Section 7.3
ArrayList

Takeaways/Thoughts

  • “parameterized types”
  • Can’t create these with primitive types (use wrapper classes)
  • List methods
  • Autoboxing and unboxing

Mapping Learning Outcomes

Outline the essential features and elements of the Java programming language.

Section 7.4
Searching and Sorting

Takeaways/Thoughts

  • Glossing over the search bits
  • Association Lists (dictionary) key/value pair get/put. Java calls them Maps. Don’t bother writing your own.
  • Shuffling was covered too.

Mapping Learning Outcomes

Explain the object-oriented design process and the concept of software engineering.

Section 7.5
Two-dimensional Arrays

Takeaways/Thoughts

  • Goes a bit into the memory representation. And different uses.
  • Goes into examples. I highly recommend doing Conway at least once… I did this in C# and found it quite enjoyable.

Mapping Learning Outcomes

Articulate the principles of object-oriented problem solving and programming. Outline the essential features and elements of the Java programming language. Apply the concepts of class, method, constructor, instance… abstraction, inheritance, … polymorphism. Explain the object-oriented design process and the concept of software engineering. Program using objects and data abstraction, class and methods in function abstraction.

References

Eck, D. J. (2019). Introduction to Programming using Java.