Unit 1 -- Csc 115 S01/S02 Spring 2005
Learning Objectives
Review of Csc 110 (intro to Java) material:
- Know the difference between Classes and Objects
- To be able to define a class with variables and methods
- To be be able to instantiate objects
- To understand how to create simple constructors
- To be familiar with the main method and how to use it for testing each class you create
- Be familiar with primitive types and how to allocate storage for them
- To gain preliminary familiarity with the String class and how to use it
- To learn naming conventions in Java
Learning Resources
Lecture slides:
1-IntroToJava.ppt
Read the
Java Sun tutorial
Read chapter 1 in the textbook.
Sample programs
Self Study Activities
Answer the following questions:
- Explain the difference between a class and an object.
Draw a conceptualized diagram of a sample class and sample object.
- What is the difference between a primitive and a reference variable?
Give an example of each.
- True or False: A primitive variable is automatically assigned a
value when you declare it.
- True or False: A variable that is a field as part of a class is
automatically assigned a value when you instantiate an object of the class.
- How can you easily spot the difference between a constructor and
an ordinary method?
There are two key clues!
- According to the conventions we usually use in Java,
what constructs are the following most likely to be:
- j
- midField
- Player
- TEAMSIZE
- getTeam()
- game
Go to the course website