The Relationship Between Java, C, and C++
C is a relatively "low level" language. This characterization is not
prejorative; it simply means that C deals with the same sort of objects the most computers do, namely characters, numbers, and addresses. These may be combined and moved about with the arithmetic and logical operators implemented on real machines
The C Programming Language
Kernighan and Ritchie
Clearly C++ owes most to C. C is retained as a subset and so is C's emphasis on facilities that are low level enough to cope with the most demanding systems programming tasks.The C++ programming language is designed to
- be a better C
- support data abstraction
- support object-oriented programming
The C++ Programming Language
Bjarne Stroustrup
Java has adopted wholesale the basic statements of C++, which in turn come
directly from C
just JAVA
Peter van der Linden
[Java was designed to be:] Object-oriented, robust, secure, architecture neutral, portable, high performance,
interpreted, threaded, and dynamic
The Java Language Environment
James Gosling and Henry McGilton
What all this tells us is that C programmers, seeing Java
for the first time, will find much that is familar. This is also the case for
those who work with C++. However, the primary goal of this section is to issue
an early warning about major differences between Java and these other two languages.
Consider the following notorious programs:
- With some exceptions (eg. use of a C++ key word), a valid C program is also a valid C++ program. No such statement can be made of the relationship between Java and C or C++.
- Java does not have a preprocessor - no #defines, #typedefs, macros, etc. We will want to know how to capture the functionality of the # statements
- Java does not have global functions - only class specific methods.
- Java does not support the key words "struct" and "union"
- Java does not support programmer defined operator overloading
Java does not support direct manipulation of pointers
Next |
Back