Flashcards
Java
Cards in this deck (8)
- 1OBJECTSObjects have states and behaviors. Example: A dog has states - color,
name, breed as well as behaviors – wagging the tail, barking, eating. An object is
an instance of a class. - 2ClassClass - A class can be defined as a template/blueprint that describes the
behavior/state that the object of its type support. - 3Java ArraysArrays are objects that store multiple variables of the same type. However, an array itself
is an object on the heap. We will look into how to declare, construct, and initialize in the
upcoming chapters. - 4Object -Objects have states and behaviors. Example: A dog has states - color,
name, breed as well as behavior such as wagging their tail, barking, eating. An
object is an instance of a class. - 5Class -A class can be defined as a template/blueprint that describes the
behavior/state that the object of its type supports. - 6 Methods- A method is basically a behavior. A class can contain many methods.
It is in methods where the logics are written, data is manipulated and all the
actions are executed. - 7Instance Variables -Instance Variables - Each object has its unique set of instance variables. An
object's state is created by the values assigned to these instance variables. - 8JAVA IDENTIFIERSAll Java components require names. Names used for classes, variables, and methods are
called identifiers.
In Java, there are several points to remember about identifiers. They are as follows:
All identifiers should begin with a letter (A to Z or a to z), currency character ($)
or an underscore (_).
After the first character, identifiers can have any combination of characters.
A key word cannot be used as an identifier.
Most importantly, identifiers are case sensitive.
Examples of legal identifiers: age, $salary, _value, __1_value.
Examples of illegal identifiers: 123abc, -salary.
Information
- Description
- Flashcards on Java, created by Francisco Guevara on 03/05/2018.
- Created by
- Francisco Guevara · May 2018
- Updated
- May 3, 2018
- Views
- 0
- Rating