Short Learning About OOP

OOP can anyone know ..? OOP is what the heck ....?? # yup very true
This time I share a little about OOP ...
That OOP stands for Object Oriented Programming, or can we call on Object-Based Programming

Object-Based Programming

The functions and data into one
entity called an object
The objects in OOP are
active
How to view: the program is not
sequence of instructions but
resolved by objects
working together to
solve the problem

Traits or characteristics of the Object
The object has a status (state) and
the behavior (behavior)
Status (state) is also called the
attribute
Examples of objects: the object of a car
- Attributes: brand, color, fuel
- Method: move persnelling,
speed increases, etc.
In OOP: the status of stored
in variables, and behavior
stored in the method

Class members (class member)
• Members of the Class consists of attributes
and method.
Each class member has
separate access control,
meaning whether the member
can be accessed for free (type
public) or only accessible
through an interface.

Attributes are data that can
distinguish between one object
with other objects
An example for a class of students
objects are the A students,
and the student object B. which
distinguish between objects the A
and B is the object of his NRP
which is an attribute of
the object.

Method in Class
Method is part of the
class that handles a
specific purpose and contains
series of commands
(= command line program)
The same object with the object
others can communicate
by using the method.

Example of class

 
class Car {
String activity, color;
int speed;
void cekKecepatan () { 
        if (speed == 0)
             activity = "parked";
           }
void  cetakAtribut () {
       System.out.println ("Activity =" + activities);
        System.out.println ("Color =" + color);
       System.out.println ("Speed ​​=" + speed);
     }

Posted in , , . Bookmark the permalink. RSS feed for this post.

Leave a Reply

Pages

Search

Sandiah Notes Template Sandroid11.blogspot.com.