To open a project, select Open from the Project menu.
To create an object, select a constructor from the class popup menu.
To execute a method, select it from the object popup menu.
To edit the source of a class, double-click its class icon.
To compile a class, click the Compile button in the editor. To compile a project, click the Compile button in the project window.
To get help for a compiler error message, click the question mark next to the error message.
Object inspection allows some simple debugging by showing an object’s internal state.
An object can be passed as a parameter to a method call by clicking on the object icon.
To create a project, select New... from the Project menu
To create a class, click the New Class button and specify the class name.
To create an arrow, click the arrow button and drag the arrow in the diagram, or just write the source code in the editor
To remove a class or an arrow, select the remove function from its popup menu.
To start using the code pad, select Show Code Pad from the View menu. (CTRL-E)
To evaluate Java expressions, just type them into the code pad.
To transfer objects from the code pad to the object bench, drag the small object icon.
To inspect result objects in the code pad, double-click the small object icon.
Statements that are typed into the code pad are executed
Use shift-Enter at the end of a line to enter multi-line statements.
Local variables can be used in single, multi-line statements. The names of objects on the object bench serve as instance fields.
Use up-arrow and down-arrow keys to make use of the input history.
To set a breakpoint, click in the breakpoint area to the left of the text in the editor.
To single-step through your code, use the Step and Step Into buttons in the debugger.
Inspecting variables is easy – they are automatically displayed in the debugger.
Halt and Terminate can be used to halt an execution temporarily or permanently.
To create a stand-alone application, use Project - Create Jar File...
To run an applet, select Run Applet from the applet’s popup menu.
To create an applet, click the New Class button and select Applet as the class type.
Non-BlueJ packages can be opened with the Project: Open Non BlueJ... command.
Classes can be copied into a project from outside by using the Add Class from File... command.
Static methods can be called from the class's popup menu.
To generate documentation for a project, select Project Documentation from the Tools menu.
The Java standard class API can be viewed by selecting Help - Java Class Libraries.
To create objects from library classes, use Tools – Use Library Class.
Java Runtime Engine
Java Software Development Kit
Command line use, Path, CLASSPATH, javac, java
Other features, import, packages, Java API, Jar files, Creating Jar Files, Javadoc, Exception handling, Applications vs. Applets vs. Servlets
Additional topics, Programming style, Debugging, Unit testing, Stepwise Development, Swing (GUI package), Packages, Classpath, Compiler, Path
Solid-line points to superclass, Superclass is more general, Parent, "is-a", "inherits from"
Dashed line points to the class of a data member, "has-a", "uses", always come from top or bottom and point to a side
Only subclasses of an abstract class can have instances, example: pets
BlueJ lets you test classes before the application is complete
document icon is README.TXT for project
structure above, instances below, "object bench"
Everything is an Object
Editor window has code and documentation views, Properly formatted comments generate documentation
Striped classes are not yet compiled
Inspector can view but not change
When we add lines between classes, how is each affected?
code pad, literals, object bench items, drag results to object bench
Static variables and methods
Superclasses and Subclasses
Nested Classes, Anonymous Classes
Access, public, private, protected
Primitive types, int, double, boolean, char, less common, float, long, short, byte
Objects, String, Array
do ... while
if / then / else
switch / case
Encapsulation, setters and getters
Inheritance, Superclasses and Subclasses
Encapsulate what varies
Favor composition over inheritance
Program to interfaces, not implementations
Strive for loosely-couples designs between objects that interact
Classes: extendable but not modifiable
Model / View / Controller
Sequences: series of steps
Loops: make the same thing happen multiple times
Parallelism: make multiple things happen at once
Events: one thing causes another to happen
Conditionals: make decisions based on conditions
Operators: math and logical expressions
Variables: storing and updating information
Lists: organize a collection of items
How can these concepts be taught without tying new students to a particular implementation?
incremental / iterative: do a little; try it out; do some more
testing / debugging: make sure things work; fix mistakes
re-using / re-mixing: build on what you or other have done
abstracting / modularizing: build a larger thing with smaller parts
expressing: I can create
connecting: I can do more when I, create with others, create for others
questioning: I can ask questions to make sense of the world (and how it works)