[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Project] [Outlines] [Labs] [Assignments] [Quizzes] [Exams] [Examples] [EIJ] [JPDS] [Tutorial] [API]
Back to Lab: Getting Started with Java. On to Lab: Objects and Methods, Continued.
Held Friday, January 28, 2000
Overview
Today's outline does not yet have an overview. Please let me know if you think it should have one.
Notes
Contents
Summary
Fraction class.
import UsefulClass;
/**
* A helpful introductory comment that describes the class.
*/
public class ClassName
{
// Field declarations
// Constructors
// Methods
} // class ClassName
protected
protected String name;
this.
public).
void when a method doesn't return anything.
public String getName()
{
return this.name;
} // getName()
public void setName(String newName)
{
this.name = newName;
} // setName(String)
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 |
protection type name(typed-arguments) |
| Function call | (function arg1 ...
argn) |
object.method(arg1 ...
argn) |
| Return value from function | value |
return value |
Tuesday, 18 January 2000
Wednesday, 26 January 2000
Friday, 28 January 2000
Back to Lab: Getting Started with Java. On to Lab: Objects and Methods, Continued.
[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Project] [Outlines] [Labs] [Assignments] [Quizzes] [Exams] [Examples] [EIJ] [JPDS] [Tutorial] [API]
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.math.grin.edu/~rebelsky/Courses/CS152/2000S/Outlines/outline.04.html
Source text last modified Fri Jan 28 09:42:44 2000.
This page generated on Sat Feb 19 16:08:25 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu