CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ

Classes

Objects and Classes
Objectives

Applied

  • Code the instance variables, constructors, and methods of a class that defines an object.
  • Code a class that creates objects from a user-defined class and then uses the methods of the objects to accomplish the required tasks.
  • Code a class that contains static fields and methods, and call these fields and methods from other classes.
  • Given the Java code for an application that uses any of the language elements presented in this chapter, explain what each statement in the application does.

Knowledge

  • Describe the architecture commonly used for object-oriented programs.
  • Describe the concept of encapsulation and explain its importance to object-oriented programming.
  • Differentiate between an object's identity and its state.
  • Describe the basic components of a class.
  • Explain what an instance variable is.
  • Explain when a default constructor is used and what it does.
  • Describe a signature of a constructor or method, and explain what overloading means.
  • List four ways you can use the this keyword within a class definition.
  • Explain the difference between how primitive types an reference types are passed to a method
  • Explain how static fields and static methods differ from instance variables and regular methods.
  • Explain what a static initialization block is and when it's executed.
| Introduction | Object | Create an object | Static fields and methods | Line item application