CS100J Examples
Notes
Previous Websites
Lecture Notes & Additional Examples
Home
Announcements
Staff&Help
Material
Exercises
Exams
Information
Syllabus
Times&Places
Examples
Projects
Grading

Notes

Back to Top

Previous Websites Back to Top

Lecture Notes & Additional Examples
Date Description File(s) Text Copies
1/23 Lecture 1 notes lecture1.txt lecture1.txt
1/25 Lecture 2 notes lecture2.txt
ascii.txt
lecture2.txt
ascii.txt
1/30 obtaining input from user (need for P2) UserIO.java UserIO.txt
1/31 Lecture 3 notes
Practice with expression statements
Find maximum value
swapping two values
lecture3.txt
Statements.java
max.java
Swap.java
lecture3.txt
Statements.txt
max.txt
Swap.txt
2/01 Lecture 4 notes
processing grades
random numbers (need for P2)
lecture4.txt
grades.java
random.java
lecture4.txt
grades.txt
random.txt
2/06 Lecture 5 notes
Lecture examples
Solutions to example
Alternative solution (more sophisticated)
Patterns for processing input 
         (copied from Spring 2000)
lecture5.txt
rms_blanks.java
rms.java
rms_alt.java
pattern.txt
lecture5.txt
rms_blanks.txt
rms.txt
rms_alt.txt
pattern.txt
2/07 Lecture 6 notes lecture6.txt lecture6.txt
2/13 Lecture 7 notes
Scope of variables in a method
demonstration of methods
lecture7.txt
scope.java
methods.java
lecture7.txt
scope.txt
methods.txt
2/15 Lecture 8 Notes lecture8.txt lecture8.txt
2/20 Lecture 9 Notes
basics of OOP
lecture9.txt
lecture9a.java
lecture9.txt
lecture9a.txt
2/26 Lecture10-11 notes and solutions L10A.txt | L10Asol.txt
L10B.java | L10Bsol.java
L10C.java | L10Csol.java
L10D.java & L10E.java
L10A.txt | L10Asol.txt
L10B.txt | L10Bsol.txt
L10C.txt | L10Csol.txt
L10D.txt & L10E.txt
2/27 default instance/class variable values
Full solution to lecture 10-11 example
defaults.java
Simulation.java
defaults.txt
Simulation.txt
3/01 Example of mechanics of OOP with explanations
Same exaple minus the explanations
Introduciton to encapsulation (public, private)
lecture12.java
lecture12_slim.java
lecture12_encaps.java
lecture12.txt
lecture12_slim.txt
lecture12_encaps.txt
3/04 Updated rules on drawing boxes. boxscope.txt boxscope.txt
3/05 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 of this
example of static
lecture13.txt
L13_person.java
L13_area_blanks.java
loneobject.java
private_constructor.java
this_iv2.java
this_iv2_blanks.java
Mixing.java
lecture13.txt
L13_person.txt
L13_area_blanks.txt
loneobject.txt
private_constructor.txt
this_iv2.txt
this_iv2_blanks.txt
Mixing.txt
3/06 Solutions
Solutions
L13_area.java
this_iv2.java
L13_area.txt
this_iv2.txt
3/08 Lecture Notes
Method Overloading
Constructors
basics of static
static examples
ramification of main as static
array example
solutions to array example
lecture14.txt
method_overload.java
constructor_overload.java
static_basics.java
static_examples.java
static_main.java
array_basics_blanks.java
array_basics.java
lecture14.txt
method_overload.txt
constructor_overload.txt
static_basics.txt
static_examples.txt
static_main.txt
array_basics_blanks.txt
array_basics.txt
3/09 Box drawing instructions
example 1
example 1 boxes - stage 1
example 1 boxes - stage 2
example 1 boxes - stage 3
example 2
example 3
example 4
boxscope.txt
drawboxes1.java
box1.pdf
box2.pdf
box3.pdf
pass1.java | pass1.gif
pass2.java | pass2.gif
pass3.java | pass3.gif
boxscope.txt
drawboxes1.txt
box1.pdf
box2.pdf
box3.pdf
pass1.txt
pass2.txt
pass3.txt
3/13 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
lecture15.txt
array_tedious.java
array_better.java
array_basics_blanks.java
array_basics.java
initlist.java
array_problems.java
lecture15.txt
array_tedious.txt
array_better.txt
array_basics_blanks.txt
array_basics.txt
initlist.txt
array_problems.txt
3/15 Lecture notes
part1 of Exercise 7 (solutions on 3/27)
solution to part 1
part2 of Exercise 7 (solutions on 3/27)
solution to part 2
lecture16.txt
classWithArrays_blanks.java
classWithArrays.java
arrayOfObjects.java
arrayOfObjects_sol.java
lecture16.txt
classWithArrays_blanks.txt
classWithArrays.txt
arrayOfObjects.txt
arrayOfObjects_sol.txt
3/27 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
lecture17.txt
aoa0_blanks.java
aoa0.java
aoa1.java
aoa2_blanks.java
aoa2.java
aoa3.java
aoa4_blanks.java
aoa4.java
lecture17.txt
aoa0_blanks.txt
aoa0.txt
aoa1.txt
aoa2_blanks.txt
aoa2.txt
aoa3.txt
aoa4_blanks.txt
aoa4.txt
3/29 Lecture notes
Savitch is unclear on pg 402
String methods
lecture18.txt
savitch402.java
string_methods.java
lecture18.txt
savitch402.txt
string_methods.txt
4/03 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
lecture19.txt
character_basics.java
string_basics.java
string_methods.java
string_equals.java
array_mode.java
selectsort.java
insertsort.java
sorting0.java
sorting1.java
sorting.html
scovetta.pdf
lecture19.txt
character_basics.txt
string_basics.txt
string_methods.txt
string_equals.txt
array_mode.txt
selectsort.txt
insertsort.txt
sorting0.txt
sorting1.txt
sorting.html
scovetta.pdf
4/05 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
lecture20.txt
inherit0.java
inherit0_detailed.java
inherit0_fruit.java
inherit1.java
inherit1_vars.java
inherit2.java
inherit3.java
lecture20.txt
inherit0.txt
inherit0_detailed.txt
inherit0_fruit.txt
inherit1.txt
inherit1_vars.txt
inherit2.txt
inherit3.txt
4/10 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...
lecture21.txt
inherit4.java
inherit5.java
inherit5_demo.java
inherit6.java
inherit6_details.java
inherit6_override.java
inherit7.java
inherit7a.java
inherit7b.java
inherit8.java
inherit8a.java
inherit8b.java
lecture21.txt
inherit4.txt
inherit5.txt
inherit5_demo.txt
inherit6.txt
inherit6_details.txt
inherit6_override.txt
inherit7.txt
inherit7a.txt
inherit7b.txt
inherit8.txt
inherit8a.txt
inherit8b.txt
4/12 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)
lecture22.txt
inherit9.java
inherit9a.java
inherit10.java
inherit11.java
inherit12.java
inherit13.java
inherit14.java
inherit15.java
inherit16.java
inherit17.java
inherit17_object.java
inherit17_toString.java
inherit17_equals.java
inherit17_clone.java
lecture22.txt
inherit9.txt
inherit9a.txt
inherit10.txt
inherit11.txt
inherit12.txt
inherit13.txt
inherit14.txt
inherit15.txt
inherit16.txt
inherit17.txt
inherit17_object.txt
inherit17_toString.txt
inherit17_equals.txt
inherit17_clone.txt
4/17 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
lecture23.txt
poly_basics.java
poly_varsmeths.java
poly_aliases.java
poly_arrays0.java
poly_arrays1.java
poly_arrays2.java
abstract0.java
abstract1.java
interface_basics.java
lecture23.txt
poly_basics.txt
poly_varsmeths.txt
poly_aliases.txt
poly_arrays0.txt
poly_arrays1.txt
poly_arrays2.txt
abstract0.txt
abstract1.txt
interface_basics.txt
4/19 Lecture notes
(see lecture23.txt for Java portion)
lecture24.m lecture24.txt
4/24 Lecture notes lecture25.m lecture25.txt
4/26 Lecture notes lecture26.m lecture26.txt
5/01 Lecture notes lecture27.m
characters.m
misc.m
symbolics.m
advanced.m
lecture27.txt
characters.txt
misc.txt
symbolics.txt
advanced.txt
5/03 Lecture notes lecture28.txt lecture28.txt
Beyond notes on exceptions & threads
exceptions
exceptions
exceptions
exceptions
threads
multiple main methods
file input and output examples
exceptionsthreads.txt
except1.java
except2.java
except3.java
except4.java
thread1.java
Mains.java
FileIO.java
exceptionsthreads.txt
except1.txt
except2.txt
except3.txt
except4.txt
thread1.txt
Mains.txt
FileIO.txt
obfuscated DIS's infamous x.java
(inspired by http://www.ioccc.org/index.html)
x.java x.txt


Back to Top
Back to CS100J Home