CISC181 Study Guide - Midterm Guide: Instance Variable, Local Variable, A Void

153 views11 pages

Document Summary

(shamelessly ripped from head first java, dave"s slides, and some kid who i mugged for his java notes sorry vikas, that was me. ) Java basics needed to get started: code structure, source file holds one class definition. A class represents a piece of a program: a class has one or more methods. A class is a blueprint for an object: a method contains instructions for how that method should be performed, variables, variables hold primitives and references. References are remote controls that allow you to access objects: variables must have a type (arraylist, int, etc. ) and a name, instance variables are declared inside a class but not within a method. Instance variables live as long as the object does. Classes, objects, methods, oh my: all java code is defined in a class, a class is a blueprint for an object.