Ziddu.com

In bequeathing Java

Diposting oleh maniactoons | 04.50 | | 0 komentar »

Inheritance

Ineritance
A mechanism to settle state and beahviour from the superclass to the subclass.
Inheritance offers a concept reused in the development of software.

Program development segitga class
triangle program
(class Segitiga
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 SegitigaKaki inherit a program segititga
SegitigaKaki Segitiga class extends (
double getKeliling () (
return base + Math.sqrt (0.5 * base * base + * high-high);
)
)

Program hitungSegitigaKaki
import java.io. *;
(class hitungSegitigaKaki
public static void main (String [] args) (
A triangle Segitiga = new ();
SegitigaKaki b = new SegitigaKaki ();
BufferedReader br = new BufferedReader (new InputStreamReader (System.in));

int temp;
System.out.print ( "Length of base:");
try (
temp = Integer.parseInt (br.readLine ());
a.setAlas (temp);
b.setAlas (temp);
) Catch (IOException e) ()
System.out.print ( "Height:");
try (
temp = Integer.parseInt (br.readLine ());
a.setTinggi (temp);
b.setTinggi (temp);
) Catch (IOException e) ()
System.out.println ( "Area is:" + a.getLuas ());
System.out.println ( "circumference is:" + b.getKeliling ());
)
)

Pemograman Java

Diposting oleh maniactoons | 04.44 | | 0 komentar »

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 ());
)
)

free WebHosting

Diposting oleh maniactoons | 11.48 | | 0 komentar »

Greetings,

We offer Free Web Hosting with no advertising, there is no catch, so what you see is what you get. Here is our offer to you:

1500 MB Disk Space
100,000 MB Bandwidth
Free Subdomain or Your Own Domain
Automated Scripts Installer (20 Popular Scripts)
FTP Access and Web Based File Manager
Easy to use Website Builder
5 MySQL Databases with Full PHP Support
Zend & Curl Enabled
IMMEDIATE Activation!

Signup Now with Instant Activation - http://www.000webhost.com/185330.html

Navigasi