Computer Science 15-100 (Sections T & U), Spring 2008
Class Notes:  Introduction to Java


Logistics

  1. Second Day
    1. Waitlists: see me today
    2. Syllabus + Course Policies
    3. Class mailing list
  2. Reading:
    1. L&L Chapter 1 (Introduction)
    2. L&L Appendix B (Number Systems)
    3. L&L Appendix C (Unicode)
  3. Hw1: due Friday (tomorrow at 10am by email to your CA)
  4. Quiz1: on Tuesday

Topic Outline:

  1. Installing Java, DrJava, JCreator
     
  2. Hello World
    1. Install software (Java + DrJava/JCreator/OtherIDE)
    2. Edit HelloWorld.java  <--- Java source file
    3. Compile with "javac HelloWorld.java" to create HelloWorld.class  <-- Java bytecode file
    4. Interpret with "java HelloWorld"  <-- The JVM (Java Virtual Machine) interprets the bytecode
       
  3. Vocabulary:
    1. Sun, Java, Java SE, Java ME, Java EE, Java 1.4, Java 1.5, Java 1.6, JRE, JVM, Browser, Plug-in, AppletWeb Startjar file, JDK (or Java SDK),  Compiler, Interpreter, Editor, IDE, Libraries (Base Libraries, Swing, etc)
    2. Class
    3. Identifier
      1. Class names are UpperMixedCase
      2. Variable and Method names are lowerMixedCase
    4. Main method
    5. Comments
      1. End-of-line Comments  // like this
      2. Block Comments   /* like this */
      3. Good Comments (clear, concise, appropriate) and Bad Comments (unclear, verbose, inappropriate -- too many / too few)
    6. String literal  "like this"
    7. System.out.println method
    8. Reserved Words (see p. 31)
    9. Identifiers Revisited:  Read The Purple Boxes!!!
    10. White space
    11. Java Code Conventions (Style Guide)
    12. Syntax versus Semantics
      "Time flies like an arrow."
      "The senator was trapped in one bad lie after another."  (Is the senator a liar or just a bad golfer?)
    13. Errors
      1. Compile-time error (Syntax error)
      2. Runtime error ("crash")
      3. Logical Error
         
  4. Problem Solving
    1. Define the problem
    2. Design the solution
    3. Implement the solution
    4. Test the solution
    5. Revise the problem or the design as needed (ie, go back to step 1 or step 2)
       
  5. Time permitting:  skim chapter 1 and/or time on hw1 (due tomorrow!)

carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem   -   carpe diem