* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package over;
/**
*
* @author User
*/
public class transportasidarat extends transportasi{
private String roda;
public transportasidarat (String roda){
this.roda = roda;
}
public transportasidarat(String nama , String transit , String bahanbakar){
this.nama = nama;
this.transit = transit;
this.bahanbakar = bahanbakar;
}
/**
* @return the roda
*/
public String getRoda() {
return roda;
}
/**
* @param roda the roda to set
*/
public void setRoda(String roda) {
this.roda = roda;
}
@Override
public String getNama(){
return nama;
}
@Override
public void setNama(String nama){
this.nama = nama;
}
@Override
public String getTransit(){
return transit;
}
@Override
public void setTransit(String transit){
this.transit = transit;
}
@Override
public String getBahanbakar(){
return bahanbakar;
}
@Override
public void setBahanbakar(String bahanbakar){
this.bahanbakar = bahanbakar;
}
public static void main(String[] args) {
transportasidarat a = new transportasidarat("Memiliki Roda");
System.out.println("Transportasi Darat "+a.getRoda());
transportasidarat b = new transportasidarat("Bus","Terminal","Premium");
System.out.println("Nama Kendaraan: "+b.getNama()+"\nTempat Transit: "+b.getTransit()+"\nDengan Bahan Bakar: "+b.getBahanbakar());
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package over;
/**
*
* @author User
*/
public class transportasilaut extends transportasi{
public String menyelam;
public transportasilaut(String menyelam){
this.menyelam = menyelam;
}
public transportasilaut(String nama , String transit , String bahanbakar){
this.nama = nama;
this.transit = transit;
this.bahanbakar = bahanbakar;
}
/**
* @return the menyelam
*/
public String getMenyelam() {
return menyelam;
}
/**
* @param menyelam the menyelam to set
*/
public void setMenyelam(String menyelam) {
this.menyelam = menyelam;
}
@Override
public String getNama(){
return nama;
}
@Override
public void setNama(String nama){
this.nama = nama;
}
@Override
public String getTransit(){
return transit;
}
@Override
public void setTransit(String transit){
this.transit = transit;
}
@Override
public String getBahanbakar(){
return bahanbakar;
}
@Override
public void setBahanbakar(String bahanbakar){
this.bahanbakar = bahanbakar;
}
public static void main(String[] args) {
transportasilaut x = new transportasilaut("Bisa Menyelam");
System.out.println("Transportasi Laut "+x.getMenyelam());
transportasilaut y = new transportasilaut("Kapal Selam","Pelabuhan","Hidrogen");
System.out.println("Nama Kendaraan: "+y.getNama()+"\nTempat Transit: "+y.getTransit()+"\nDengan Bahan Bakar: "+y.getBahanbakar());
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package over;
/**
*
* @author User
*/
public class transportasiudara extends transportasi{
public String Roda;
public String Sayap;
public transportasiudara (String Roda,String Sayap){
this.Roda = Roda;
this.Sayap = Sayap;
}
public transportasiudara(String nama,String transit,String bahanbakar){
this.nama = nama;
this.transit = transit;
this.bahanbakar = bahanbakar;
}
/**
* @return the Roda
*/
public String getRoda() {
return Roda;
}
/**
* @param Roda the Roda to set
*/
public void setRoda(String Roda) {
this.Roda = Roda;
}
/**
* @return the Sayap
*/
public String getSayap() {
return Sayap;
}
/**
* @param Sayap the Sayap to set
*/
public void setSayap(String Sayap) {
this.Sayap = Sayap;
}
@Override
public String getNama(){
return nama;
}
@Override
public void setNama(String nama){
this.nama = nama;
}
@Override
public String getTransit(){
return transit;
}
@Override
public void setTransit(String transit){
this.transit = transit;
}
@Override
public String getBahanbakar(){
return bahanbakar;
}
@Override
public void setBahanbakar(String bahanbakar){
this.bahanbakar = bahanbakar;
}
public static void main(String[] args) {
transportasiudara z = new transportasiudara("Punya Roda","Punya Sayap");
System.out.println("Transportasi Udara "+z.getRoda()+" dan "+z.getSayap());
transportasiudara y = new transportasiudara("Pesawat","Bandara","Aftur");
System.out.println("Nama Kendaraan: "+y.getNama()+"\nTempat Transit: "+y.getTransit()+"\nDengan Bahan Bakar: "+y.getBahanbakar());
}
}
Posted by 23.31 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar