Week 2

Introduction / Science of Abstraction

  • Office hours: posted!

Understanding Objects in Java

Origins of Java (sidebar 2.1) 1)

  • Java is a successor to Scheme and SmallTalk (among other languages).
  • Java is only superficially (syntactically) similar to C and C++. Semantically, Java is very different from these and other languages.

Packages 2)

  • Java source files may be organized into packages. Every source file in package p must begin with the declaration
    package p;

    and must be stored in a subdirectory called p.

  • A class declared in a source file with no package declaration belongs to the anonymous default package.
  • Our BlueJ projects last year in 102 were all default package projects, but the projects we create in Netbeans this semester will all have explicit package declarations.
  • Class C within package p may be imported explicitly using

    import p.C;

    or all classes within package p may be imported using wildcard notation:

    import p.*;

  • Let’s take a look at named and default packages in Netbeans.

Objects and Variables 3)

  • Stack and Heap diagrams figure 2.2 (p. 19)
  • Exercises 2.1, 2.2, 2.3, 2.4
    • Exercises 2.1, 2.2, and 2.3 are HW for next Monday’s class
1) Liskov p. 16
2) Sestoft pp. 72-73
3) Liskov Section 2.3
courses/cs203-201301/week2.txt · Last modified: 2013/01/28 11:49 by mlsmith
VCCS Top Events Extended Site Search Login Vassar Science Web Vassar Home Driven by DokuWiki Valid XHTML 1.0