Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class nestedFunc {
- public static void main(String[] args) {
- nestedFunc bola = new nestedFunc();
- bola.permukaan(14);
- bola.volume(14);
- }
- public void permukaan(double r){
- System.out.println("Lingkaran");
- double p =4 * (( 22 / 7) * r * r );
- System.out.println("Permukaan: " + p);
- }
- public void volume(double r){
- double v = 4/3 * ((22/7) * r * r * r);
- System.out.println("Volume: " + v);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement