• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/32

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

32 Cards in this Set

  • Front
  • Back

Class

Template that describes the state and behaviour that objects of its type support.

Object

Instance of a class, with its own state and access to behaviours of the calss

State

Unique set of instance variables as defined in the class.

Behaviour

Methods of the class

Inheritance

Allowing code from one class to be reused in other classes

Interface

Completely abstract super-class that defines which methods a subclass must support, without any implementation

Legal Identifiers

Must start with a:


LETTER,


CURRENCY CHARACTER, or


CONNECTING CHARACTER.


Also, not a keyword

:> javac

javac [options] [source files]



:> java

[options] class [args]

Magic Main Method

public static void main(String[] args)

Types of Modifiers

Access modifiers


Nonaccess modifiers

Interface Constants' Modifiers

public, static, final

Public Member Access

All other classes, regardless of package, can access the member

Private Member Access

No code can be used anywhere except in that class

Default Member Access

Class may be accessed by any class in the package

Protected Member Access

May be accessed in the package by all, and outside the package through inheritance only (as opposed to by reference)

Final Method

Cannot be overidden by a subclass

Final Arguments

Cannot be changed by the method

Abstract Methods

Has been declared but not implemented


(nb: Must declare class abstract)

strictfp

May declare class or method


Uses IEEE 754 standard on floating point numbers

Arguments

Things you specify between parenthesis when invoking a method

Parameters

Things the method's signature that indicates what the method must receive when it is invoked

Primitive Variables

char, boolean, byte, short, int, long, float, double

Reference Variables

Refers to an object. Can be of the declared type or any of its subtype

Instance Variables

Variables declared and used inside the class


Are assigned default values


Can be any access level


Can be final, transient


Cannot be abstract, synchronized, strictfp, native

Local Variables

Stored on the stack


Declared in method, dies at the end


Are not assigned default values

Final Variables

Primitive - once assigned, always that value


Reference - the object may change its state, but the reference remains pointed at the same object

Transient Variables

When serializing object, the JVM ignores this variable


Can only be used for instance variable

Volatile Variable

Variable must always reconcile its own private copy of the variable with the master copy


Can only be used with instance variables

Static Variables and Methods

Operate independently of any instances of the class

Declaring enums

enum State { EMPTY, HALFFULL, FULL};

Constant Specific Class Body

A special section of code only for a specific element of the enum