What is an Object
An instance of a Java class.
Memory is allocated as soon as an object is created
Can create as many objects as neccesary.
Class = car.. Object = Subaru, BMW, Ford
What is a Class
Used to create Objects
defines Objects data types, and methods
Allocates no memory
Can only be declared once
Class = car .. Object = BMW, Subaru, Ford
What is a Method
A block of code that only runs when it is called.
Has parameters (data) passed into it
Used to perform certain functions (actions)
Write the code once, use it over and over.
Enumerators
a data type that allows you to traverse a collection. (example: for each loop)
Constructor
A special method used to initiate objects
arrayNam[ ] <--- ............ list( ) <---
args
example:
public static void main(String[] args)
args is a string array, containing the "arguments", or input, from the command line, that is used to configure the application or program.
Stack memory
stores temporary data that is created by a function
when the function is complete, the data is erased
LIFO (last in first out)
methods, local variables reference variables
Heap memory
stores global variables
Dynamic memory allocation (allotting memory blocks/cells as they are needed, removes waste)
Primitive Variables
byte, short, long, int, float, double, char.
store the actual value of the data
Primitive variables are stored in stack memory
Reference variables
Class, Object, Array,
stores the location of the data within the memory
uses Heap memory
Wrapper class
a class that 'wraps around' a primitive data type, making it appear like an object, so that it can interact with additional methods (such as parseInt(), valueOf() etc)
Autoboxing
procedure of converting primitive data type, to an object, of the corresponding wrapper class.