Created
September 29, 2019 23:48
-
-
Save sugiartocokrowibowo/95461e13167d1726488e327c8f2f4311 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LatihanClassObjectMethod003{ | |
double panjang = 12; | |
double lebar = 7; | |
void cetakPanjang(){ | |
System.out.println("Panjang Kotak: "+panjang); | |
} | |
void cetakLebar(){ | |
System.out.println("Lebar Kotak: "+lebar); | |
} | |
double hitungLuas(){ | |
double luas = panjang * lebar; | |
return luas; | |
} | |
void setPanjangLebar(double p, double l){ | |
panjang = p; | |
lebar = l; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment