Midterm OOP - Lesson 2 Flashcards
are user – defined data types and it behave like built in types in
a programming language.
class
a group of conceptualized related state and behavior (objects)
class
it is a model or template for objects (objects are variables of the class)
class
are the basic run – time entities of an object oriented programming
OBJECT
they may represent a person, place, or any item that the program must handle
OBJECT
bundle of related state and behavior
OBJECT
things that an object can do (function)
behavior
properties that describe the specific instance (appearance)
state
when a program is executed, the ________ are interacting with each other
OBJECT
(4) ACCESS MODIFIERS
Public, Private, default, protected
Access modifier: method, class, variables (for main class only)
public
Access modifier: method, class, variables
private
Access modifier: class, variables (for subclass only)
default
Syntax for Class
access modifier class className {
}
public static void hakdog {
}
is a non - access modifier in Java that allows user to access an object/class without any reference to any other object.
static
is a part of a program that allows user to create an instance of a specific object/class.
constructor
you don’t need to create any instance of an object if it is declared as static.
Constructor
substitute for the data type if the object (specifically method) doesn’t have a return value.
VOID
a keyword that is used if a method / object has a value to return.
RETURN
if the method declared as void then you cannot use return keyword
okie
an object that can be built in or user defined
METHOD
one of the** basic foundation** of OOP
METHOD
you can call a method inside another method of the same type
okies thenks
Syntax for method
accessModifier static/not datatype methodName (parameters) {
}
public static int add(int x){
}