/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package constructorjava;
class LuasSegitiga{
int panjang;
int tinggi;
int lebar;
public void LuasSegitiga(int p,int l,int t){
this.panjang=p;
this.lebar=l;
this.tinggi=t;
}
public int luas(){
return (panjang*tinggi*lebar);
}
}
/**
*
* @author andi m
*/
public class ConstructorJava {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
LuasSegitiga A=new LuasSegitiga();
A.LuasSegitiga(4, 4, 4);
System.out.println(A.luas());
}
}
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package constructorjava;
class LuasSegitiga{
int panjang;
int tinggi;
int lebar;
public void LuasSegitiga(int p,int l,int t){
this.panjang=p;
this.lebar=l;
this.tinggi=t;
}
public int luas(){
return (panjang*tinggi*lebar);
}
}
/**
*
* @author andi m
*/
public class ConstructorJava {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
LuasSegitiga A=new LuasSegitiga();
A.LuasSegitiga(4, 4, 4);
System.out.println(A.luas());
}
}
No comments