Page 75 - PowerPoint Presentation
P. 75

1.6               1.6.3           MEMBEZAKAN ANTARA FUNCTION DAN

                                                PROCEDURE PADA SUBATUR CARA





                                     CONTOH ATURCARA


                       FUNGSI                                         PROSEDUR


      static int mintaNombor ( ) {                      static void hello () {
         int nom;                                       System.out.print (“Hello dunia.”);
         java,util.Scanner sc;                          }
        sc = new Java.util.Scanner (System,.in);

      nom = sc.nextInt();
      Return nom
      }

      int jumlahNombor ( int x, int y ) {               static void hello (String nama) {
      Int jumlah;                                       System.out.print (“Hello “ + nama );

      Jumlah = x + y;                                   }
      Return jumlah;

      }

                                                        static void cariJumlah (int x, int y )
                                                        {

                                                        Int jawapan = x + y;
                                                        System.out.print (jawapan);
                                                        }






























                                                                                                  75
   70   71   72   73   74   75   76   77   78   79   80