CSC207H1 Lecture : oct10c.docx
Document Summary
Access modifiers: private parent instance variables/methods can"t be accessed. A few quick points about abstract classes and interfaces: a class may define methods w/o giving a body. Each of those methods must be declared abstract. The class must be declared abstract too. The class can"t be instantiated: a child class may implement some or all of the interited abstract methods. If all, it"s not abstract and can be instantiated: if a class is completely abstract, we can choose instead to declare it to be an interface. October 10: some generics we"ve seen: comparable, public interface comparable , * compare this object with o for order. Suppose you wantd stacks of strings (and that java didn"t already implement them for you) Very non-generic stacks, can only deal with string objects: Stack. java: package nongeneric, public class stack, string[] contents; // the contents of this stack.