Lecture 5 notes
Lecture examples
Solutions to example
Alternative solution (more sophisticated)
Patterns for processing input
(copied
from Spring 2000)
Lecture 13 notes
Person example with encapsulation
Demo of encapsulation with computing area
Making "lone objects" (no references)
Can constructors be private?
Using this examples ofthis example of static
Lecture notes
array motivation: what NOT to do
array motivation: what to do
array example
solution to array example
initializer lists
common mistakes with arrays
Lecture notes
0) array of arrays exercise
0) array of arrays exercise solution
1) array of arrays (box diagrams)
2) array of arrays (lecture example)
2) lecture example solutions
3) array of arrays (common error)
4) row major vs col major (lecture example)
4) row/col solutions
Lecture notes
characters
basics of Strings
String methods
equals vs ==?
searching example
select sort
insert sort
both select and insert sort
more demos of basic sorting
someone else's information
Mike's Lab2
Lecture notes
basics of inheritance (using extends)
example of basics
simple example using fruit
inheriting public fields
another example of inheriting public fields
inheritance: this and super
constructors
inheritance: tracing object construction
Lecture notes
more about inheriting variables
more about inheriting methods
further demos of inheriting methods
overriding methods
same example with more comments
briefer exmaple of method overriding
shadowing variables
more on methods calling shadowed vars
more on methods calling shadowed vars
using the super reference
more on using the super reference
you can't do super.super...
Lecture notes
encapsulation and inheritance
private constructor and this(...) using super to "see" a private member
a method sees a private member
more on super private member and shadowing
cannot make modifers more restrictive
static and inheritance
final and inheritance
Object class
extending a class from Object more on toString more on equals cloning (optional)
Lecture notes
basics of polymorphism
polymorphism with instance vars/meths
polymorphism and aliases
polymorphism and arrays (brute force)
- same example, more elegant
- more interesting and practical example
abstract class basics
older example of abstract classes
interface demo