INTRODUCTION oop
Oop, Object Oriented programming
Pemograman a form that supports Encapsulasi, Inheritance, and Polymorphyms
a class pemograman language and techniques that are based on an object, where data structures terenkapsulasi routine that operates with the data.
Triangle Program
class Triangle (
protected int base;
protected int level;
void setAlas (int newValue) (
base = newValue;
)
void setTinggi (int newValue) (
high = newValue;
)
double getLuas () (
return 0.5 * base * high;
)
)
Program calculated the triangle
(class hitungsegitiga
public static void main (String [] args) (
s triangle = new Triangle ();
s.setAlas (9);
s.setTinggi (9);
System.out.println ( "Area is:" + s.getLuas ());
)
)
0 komentar
:)) :)] ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* : 8-} ~x( :-t b-( :-L x( =))
Posting Komentar