A Student (ehem) borrowed my book, but from my recollection, here are the highlights. 1. Basic Terms--lets don't define these individually, but discuss in context. Class method Fields: class (static) variables instance variables (primitive or objects) subclass (extends) Object: new xxx; constructor (what new causes to happen) public/private/protected--apply to class or method or variable instantiate instance static primitive types instance variable return (single valued "thing": primitive, object, array) abstract class (class methods, can't be instantiated) interface (list of methods only) scope 2. What's so great about an Object? data hiding manageable code. polymorphism (overloading) inheritance 3. What are the big plusses for Java? Collections Library: "container for several objects" Ease of use Several more-convenient-than C aspects (no header files) (variables can be declared anywhere) (better compiler warnings) (initialization of arrays) Garbage Collection (no memory leaks ? or fewer...) Cross-platform portability Exception handling (try/catch/throw) Threading (we won't bother about that) 4. Syntax classes start with Capital Letters. methods start with small letters, use capitals to indicate "smashed together" words. period separator, eg with object x and method doThat() x.doThat() if x has a public IVAR openSecret, you can get it easily: int xIVAR = x.openSecret If the variable is private or protected, this won't work! The class must instead create a method that you use to ask for the value, as in public int getOpenSecret(){ return openSecret; } The critical thing is that information can be hidden and the class can restrict information and give it out whenever it wants. Note you also have to write a set method to put the variable into an object, as in public class Whatever extends Object 5. Eckel's Chapter 3 misc big difference between = and == ! i++ and ++i j = i++; //j = i //i= i+1 j = ++i ; // j= i+1 control Conditional if (x == y){ } int x, y, z; if ( (x = y) == z) elseif { } else { } Ternary operator x ? y : z switch (list of conditions, what to do for each) good substitute for complicated series of if if/else. boolean true or false boolean x = true; boolean y; if (whatever){ y = false }; if ( x ) { }; if ( y ) {}; if (x && y) { } //logical and if (x || y) { } //logical or int z = 1; if (z) {} // javac error, condition is not a logical operator if (z == 1) { command; command;} // if (z == 1) command; // no squiggly braces! command2; //conditional does not control this command3; Loops for (i= 0; i < N; i++) while (i < N){ anything!; i++ } do { anything; i++ } while (i < N-1) Don't use GOTO. Those are stupid BASIC conventions. Soliloquy on subclassing! Example Class FootballPlayer extends Object void run(int x, int y); void hit(FootballPlayer x); int getIQ(); Lineman extends FootballPlayer void block (FootballPlayer x); void dribbleSnot (); void getIntoMud(); inherits (from FootballPlayer) void run(int x, int y); void hit(FootballPlayer x); int getIQ(); Lineman is a subclass of FootballPlayer. Center extends Lineman void snap(FootballPlayer evilBastard); inherits methods from Lineman and FootballPlayer Center is a subclass of Lineman (and also FootballPlayer) Tackle extends Lineman void eatTonsOfFood(); inherit from Lineman and FootballPlayer So Far, I only add new methods. But I can also "override" old methods. TightEnd extend Lineman void getIntoMud()--replaces method in Lineman. ShannonSharp extends TightEnd getIntoMud from TightEnd Override that void getIntoMud()--replaces method in TightEnd this.getIntoMud() same as getIntoMud() super.getIntoMud() uses TightEnd's getIntoMud method (check book, but) this.