public class Method1{
private int umur =18;
private String nama="Galih";
public int getUmur(){
return umur ;
}
public String getNama(){
return nama;
}
//method main
public static void main (String args[]){
Method1 m1 = new Method1(){
System.out.println(m1.getUmur());
System.out.println(m1.getNama());
}
}
Tidak ada komentar:
Posting Komentar