fork download
  1. class Burung {
  2. void suara() {
  3. System.out.println("Kicau");
  4. }
  5. }
  6.  
  7. class Anjing {
  8. void suara() {
  9. System.out.println("Guk-guk");
  10. }
  11. }
  12.  
  13. public class Main {
  14. public static void main(String[] args) {
  15. Burung burung = new Burung();
  16. Anjing anjing = new Anjing();
  17.  
  18. burung.suara();
  19. anjing.suara();
  20. }
  21. }
Success #stdin #stdout 0.07s 52596KB
stdin
Standard input is empty
stdout
Kicau
Guk-guk