CSC 171 Lecture Notes - Lecture 4: Functional Programming
Document Summary
A named collection of data storage and access methods. Can be shorthand for assigning something of that type. Classes can be either public or private. Classes are composed of internal variables and methods (methods in java are what python calls functions: constructor() is a special method. Inheritance (classes can extend each other: public class leaf extends actor (the leaf actor is already a class, but we want to add stuff to it) Constructor() method is a special type of method that is named the same thing as the name of the class. it is executed the rst time you run and not again. Act() method happens every time the code is run. Methods (functions) do two things: producers: just a collection of statements to be executed one at a time, allows for abstraction, functional programming: do something and return the results as a value for reference.