CSCE 3193 Lecture Notes - Lecture 8: Instance Variable, Pop Quiz
Document Summary
String s = foo ; s = something else ; Mystring ms3 = mystringmanipulator(ms); s = foofoo ; when you initialize strings with constants, if identical strings are made, identifiers point to same id. equals compares strings char by char, == compares id. Keyword extends creates class which inherits attributes and behaviors form another class. Direct superclass- superclass form which subclass explicitly inherits. Indirect -any class above the direct superclass in the hierarchy. Java hierarchy begins with class object, every class inherits from. Subclass- new class; can add its own fields and methods, more specific. Object of subclass also treated as object of superclass. Object contains as members references to other objects. Class"s public members are accessible wherever the program has a reference to an object of that class or on of its subclasses. Private members only accessible within the class itself. Protected access is an intermediate level of access between public and private.