Comparison of ABAP and Java

Comparison of ABAP and Java

This is a comparison of the ABAP with the Java programming language. As two modern object oriented, garbage-collected programming languages, there are many conceptual similarities. However, the two languages with completely different histories also have many differences. This page documents the strong general similarities of the languages and points out those areas where the languages differ. Both languages were designed carefully, and if one language has a feature another lacks it is the result of a conscious design decision. Thus, the reader is advised to avoid the temptation to 'keep score,' and instead think about why the designers made each decision.

Language

Syntax

While Java's syntax is based on C and C++, the syntax of ABAP is not based entirely on a previous language, but has some syntax elements in common with COBOL).For example, each statement ends with a semicolon (;) in Java, while ABAP uses a dot (.). Character strings are surrounded by double quotes in Java (") and single quotes (') in ABAP.
Comments are indicated by // or /* in Java and by * or " in ABAP. Whitespace is usually ignored in Java, while it can make a difference in ABAP. [ [http://www.abap2java.com/Whitespace Whitespace in ABAP and Java] ]

Parameters in method calls are given the specified order in Java, while the parameter names usually have to be given in ABAP (Named parameters). Java supports one or no returning parameters of a method, and any number of importing parameters, while ABAP supports also several exporting or changing parameters.

Both languages do not support operator overloading as well.For many of the operators in Java (+, -, =), ABAP offers built-in functional keywords (ADD, SUBTRACT, MOVE).

Furthermore, both ABAP and Java do not allow pointer arithmetic, by which certain addresses in memory can be explicitly be accessed in languages like C, which are considered unsafe by some language designers.


= Example ("Hello World") =

ABAP

PROGRAM TEST.WRITE 'Hello World'.

Java

// Hello.javapublic class Hello{ public static void main(String [] args){ System.out.println("Hello World");

Data types

Both languages support the idea of primitive types. ABAP has more primitive types than Java, for example a special built-in floating point data type called PACKED or P, or the character type NUMC that can only contain numeric characters.In contrast to ABAP, Java has a built-in boolean type, while ABAP programmers usually use a character type with the length 1 for this. [ [http://www.abap2java.com/Data_type Comparison of data types in Java and ABAP] ]

Strings are supported by both languages.

ABAP allows the programmers to create self-defined composite data types, which are called structures.

Since ABAP release 4.5, self-defined data types can also be defined in the so-called ABAP dictionary, [ [http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ea0b446011d189700000e8322d00/frameset.htm The ABAP Dictionary on help.sap.com] ] which makes these definitions available across different applications.

Object handling

Both languages are object oriented. Java was object oriented from the beginning, while object oriented concepts were embedded into the ABAP language with release 4.6. Both languages use garbage collection as a means of reclaiming memory resources, rather than formal de-allocation of memory.

Platform independence

Java Code can run independently on a client or centrally on a server. Java code is not compiled into machine code, like many other languages including ABAP, but into byte code. This code is interpreted by the platform-specific Java Virtual Machine (JVM), which translates the byte code into the machine code of the platform. Thus, Java can run on any platform for which such a JVM is available.

ABAP code usually does not run directly on a client, but on an application server. Clients usually connect to the server via SAPgui or a web browser (BSP, WebDynpro). Therefore, ABAP applications can be used on any client for which a SAPGui client or a web browser is available.

History

ABAP is much older than Java. While Java was released by Sun Microsystems in 1995, [Jon Byous, [http://java.sun.com/features/1998/05/birthday.html "Java technology: The early years"] . Sun Developer Network, no date [ca. 1998] . Retrieved April 22, 2005.] ABAP was created by SAP in the 1980s as the report language for its business application SAP R/2. Until today, ABAP is mainly used inside SAP as well as by SAP customers and consultants, to develop, modify, and extend SAP applications, like SAP R/3 or SAP ERP. SAP's newest platform solution NetWeaver supports both ABAP and Java. Java, on the other hand, was never intended to be used inside a certain company or for a certain product only, but focused on a broader market from the beginning. It is now widely used in many different programming areas such as network computing, web applications, or business software. All the concepts that ABAP supported since the first release are still supported and all the keywords are still valid, which is one reason why ABAP has many more keywords than Java.

See also

* Comparison of Java and C++
* Comparison of the Java and .Net platforms

References

External links

* [http://java.sun.com/docs/books/jls/ Java Language Specification (Sun)]
* [http://help.sap.com SAP Help Portal]
* [http://www.sdn.sap.com/irj/sdn/developerareas/abap ABAP] in the [http://www.sdn.sap.com SAP Developer Network]
* [http://www.abap2java.com ABAP2Java.com - Online Dictionary and Translation between ABAP and Java]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Comparison of programming languages (object-oriented programming) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • Comparison of programming languages (syntax) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • Comparison of regular expression engines — Contents 1 Libraries 2 Languages 3 Language features 3.1 Part 1 3.2 Part 2 …   Wikipedia

  • SAP Web Application Server — SAP NetWeaver Application server is a component of the NetWeaver solution which works as a web application server to SAP solutions. From the SAP point of view the Web AS is the foundation on which most of their product range runs.OverviewIts… …   Wikipedia

  • Model–view–controller — A general representation of the MVC design pattern. Model view controller concept. The solid line represents a direct as …   Wikipedia

  • List of tools for static code analysis — This is a list of significant tools for static code analysis.Historical products* Lint the original static code analyzer of C code.Open source or Noncommercial products .NET (C#, VB.NET and all .NET compatible languages) *… …   Wikipedia

  • Object-oriented programming — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computing …   Wikipedia

  • COBOL — For other uses, see COBOL (disambiguation). COBOL LANGUAGE Paradigm(s) procedural, object oriented Appeared in 1959 (1959) Designed by Grace Hopper, William Selden, Gertrude Tierney, Howard Bromberg, Howard Discount, Vernon Reeves, Jean E.… …   Wikipedia

  • Bracket — 〈 redirects here. It is not to be confused with く, a Japanese kana. This article is about bracketing punctuation marks. For other uses, see Bracket (disambiguation). Due to technical restrictions, titles like :) redirect here. For typographical… …   Wikipedia

  • C++ — У этого термина существуют и другие значения, см. C. См. также: Си (язык программирования) C++ Семантика: мультипарадигмальный: объектно ориентированное, обобщённое, процедурное, метапрограммирование Тип исполнения: компилируемый Появился в …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”