Object-Oriented Programming(OOP)

An Approach to creating and using models of physical or imagined objects

Class:

A Programmer-defined blueprint from which objects are created. A blueprint for how to create an instance of itself

Attributes: Characteristics of an Object

Behaviors: Actions that an object can perform

Object: An instance of the class

Instantiate: To call the constructor to create an object

Constructor: A block of code that has the same name as the class and tells the computer how to create a new object.

Reference Variable: A variable that points to an object

State: The Attributes represented by the object's instance variables

Camel Case:

Naming convention where the first letter of the first word is upper or lowercase, and the first letter of each additional word is uppercase

Calling Methods

Methods: A named set of instructions to perform a task

Parameter: A variable in the method that defines the type of value to receive when the method is called.

Begins with the name of the object, a dot operator, name of the method, and an argument within parentheses

Dot Operator: Used to call a method in a class

Argument: Value passed to a method when the method is called.

Types of Values

  1. Numbers: Integers, Floats, Doubles
  2. Text: String, Characters
  3. True or False: Boolean

Taken from CSA: Object-Oriented Programming, CSA: Creating Objects, and CSA: Calling Methods by Code.org

System.out.println("Hello");
Hello
char output = 'A';
for (int i = 0; i < 26; i++){
    System.out.println(output);
    output++;
}
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
static void test(){
    System.out.println("Testing");
}
static void number(){
    System.out.println("3");
}
public static void main(){
    test();
    number();
}
main();
Testing
3