Fundamentals of Computer Science II (CSC-152 2000F)


Class 04: Lab: Objects and Methods

Back to Lab: Getting Started with Java. On to Lab: Objects and Methods, Continued.

Held Wednesday, August 30, 2000

Summary

Today we move more toward the object-oriented side of Java by considering details of classes and objects. Today's class involves both discussion and hands-on work.

Notes

Overview


Building Classes

The Class Declaration

Fields

Methods

Constructors

Scheme vs. Java

Just so you know what you're getting into, I've put together a small chart comparing Scheme to Java.

Category Scheme Java
Size Small Huge
Syntax Parentheses Lots
Paradigms Functional, Imperative Object-Oriented, Imperative
Data Types List, Vector, String, Number, Atom Primitive (numbers, characters), Object, String, ...
Types Implicit, Run-time Explicit, Compile-time
Hurdles/Benefits Anonymous functions; functions as data Size; exceptions; polymorphism
Execution Model Interpreted Compiled (plus JVM interpreter)
Function declaration (define name
  (lambda (arguments)
    body))
protection type name(typed-arguments)
{
  body
}
Function call (function arg1 ... argn) object.method(arg1 ... argn)
Return value from function value return value

Lab: J2

Preparation

Are there questions on the lab?

Work

Start working on lab J2.

Reflection

There will be no reflection today. Prepare to reflect on Friday.


History

Wednesday, 23 August 2000

Thursday, 24 August 2000

Wednesday, 30 August 2000

Back to Lab: Getting Started with Java. On to Lab: Objects and Methods, Continued.


Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/2000F/Outlines/outline.04.html

Source text last modified Wed Oct 25 10:05:37 2000.

This page generated on Fri Oct 27 08:19:45 2000 by Siteweaver. Validate this page's HTML.

Contact our webmaster at rebelsky@grinnell.edu