CSC152 2004F, Class 3: An Introduction to Java Admin: * Quiz: What is the definition of OOP you found and how does it relate to what I said in class? Make sure to give me the URL you found. mail to * EBoards * Change in standard way of teaching Java. * Handouts forthcoming. * Homework: Extend today's example in any way you see fit. Overview: * Your first Java program. * Configuring the MathLAN for Java. * Your first Java program, revisited. * Adding input (if there's time) Your first Java program: * Begin with package SOMENAME * Packages group related objects/classes together * Followed by "public class SOMENAME" * Class names begin with capital letters and are mixed case * (See sample code) * Two steps to running Java programs: * (1) Compile the .java files with "jc FILENAME.java" * (2) Run the main method in some compiled file with "ji PACKAGE.FILENAME" * Some morals from writing the code: * You name objects with TYPEOFOBJECT NAMEOFOBJECT (let ((foo ...))) * Java requires you to *type* every object (say what role it plays) * You usually create new objects with = new TYPEOFOBJECT(SOMEPARAMS) * Once you've created an object, you tell it to do something NAMEOFOBJECT.METHODNAME(PARAMS) * How will you learn what kinds of objects you can create and what methods they have? * Reading and reference * Experience (e.g., you remembmer string-ref, string-append, string<=?) * You will soon design your own objects (which you should then know about)