ABAP Objects vs Java: Hello World

Mungkin ada yang ingin tahu perbandingan OOP antara ABAP Objects dengan Java untuk program “Hello World”. Pada ABAP, bagian deklarasi class dipisahkan dengan bagian implementasi class (mirip Delphi).

 REPORT  z_oo_hello_world.

 *----------------------------------------------------------------------*
 *       CLASS welcome DEFINITION
 *----------------------------------------------------------------------*
 CLASS welcome1 DEFINITION CREATE PUBLIC"public class
   PUBLIC SECTION.
     CLASS-METHODS main.                  "public static void method
 ENDCLASS.

 *----------------------------------------------------------------------*
 *       CLASS welcome IMPLEMENTATION
 *----------------------------------------------------------------------*
 CLASS welcome1 IMPLEMENTATION.
   METHOD main.
     WRITE 'Hello World!'.
   ENDMETHOD.
 ENDCLASS.

 START-OF-SELECTION.  "Execute main
   welcome1=>main( ).

 *----------------------------------------------------------------------*
 *       Compare to Java
 *----------------------------------------------------------------------*
 * public class welcome1 {
 *     public static void main(String[] args) {
 *         System.out.println( "Hello World!" );
 *     }
 * }
Ditulis dalam Java, SAP. Kaitkata: , , . Tinggalkan sebuah Komentar »

Tinggalkan Balasan

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Ubah )

Twitter picture

You are commenting using your Twitter account. Log Out / Ubah )

Facebook photo

You are commenting using your Facebook account. Log Out / Ubah )

Connecting to %s

Ikuti

Get every new post delivered to your Inbox.