Examples from Class

Please report broken links to azs@bu.edu

Class meeting Concept Examples from class
Thu 18 January General Java syntax, Standard output
HelloWorld.java
Tue 23 January Standard output
Variables, data types, constants
Assignment statements
Arithmetic
StandardOutput.java
DataTypesAndVariables.java
Arithmetic.java
Thu 25 January Casting
Math class
Standard Input
SwappingValues.java
FunWithCasts.java
HigherMath.java
InputFromKeyboard.java
Tue 30 January Class and Objects
Calling methods - general forms
UsingObjectMethods.java
UsingClassMethods.java
Thu 1 February Calling methods and passing arguments
Introduction to Graphics (coordinates, drawing, basic Colors)
Object reference variables.
Object creation using new.
Drawing.java [some code to get us started]
Drawing.java (the drawing I did in class)
Tue 6 February Object creation (revisited), using constructors.
Date and String objects
UsingDate.java
JavaStrings.java
Thu 8 February Factory methods, class Calendar.
Accessor and mutator methods
Wrapper classes (e.g. Double)
UsingCalendar.java
UsingDouble.java
Tue 13 February Expressions
selection using if statements.
Expressions.java
Branching.java
Thu 15 February Selection: continued
Comparing floating point numbers,
Switch statements
MinOf3Ints.java
ComparingFloatingPointNumbers.java
MultipleChoice.java
Thu 22 February Comparing objects (e.g. String),
Repetition using while loops loops.
Sentinel-controlled repetition.
Counter-controlled repetition.
ComparingObjects.java
BottlesOfBeer.java
SentinelControlledLoop.java
YesOrNo.java
BusyLoop.java
ValidatingUserInput.java
Tue 27 February Repetition using do-while (briefly)
Repetition using for loops
SavingsExampleDoWhile.java
Counting.java
Hangman.java
Thu 1 March User-defined classes
member variables
Circle.java
Tue 6 March User-defined classes: constructors, methods
Circle.java [updated]
UsingCircle.java [updated client code]
Drawing.java [graphical client]
Thu 8 March User-defined classes: methods, return values
toString, equals methods
Circle.java
UsingCircle.java [updated client code]
Tue 20 March Java collections, generics
class Vector, for...each loop
ListOfNames.java
Thu 22 March Review encapsulation, user defined class, methods
Associative collection -- TreeMap
Having a collection as an instance variable of a class
BankAccount.java
StockPortfolio.java
StockClient.java
Tue 27 March Databases, introduction to SQL.
sql_queries.txt
Thu 29 March JDBC, using classes
java.sql.Statement,
java.sql.ResultSet.
BaseballProgram.java
BaseballClient.java
Tue 3 April Introduction to Graphical User Interfaces.
SampleGUI.java
Thu 5 April GUI I/O: labels, text boxes, buttons, events.
GUIInputOutput.java
Tue 10 April GUI I/O: Validating input GUI Selection: check boxes, radio buttons.
GUIInputOutput.java [updated]
GUISelection.java
Thu 12 April GUI Selection: combo box, lists.
GUIWithComboBox.java
GUIWithJList.java
Tue 17 April Multiple window GUI applications
Callback design pattern
MainWindow.java
SubDialog.java
Tue 19 April JavaBeans, middle ware component between GUI and database.
BaseballTeam.java
BaseballPlayer.java
DBInterface.java


Created by: Aaron Stevens, azs@bu.edu
http://www.cs.bu.edu/courses/cs108
Last update: 19 April 2007