|
Java and C++ both can be considered object-oriented
languages to a reasonable degree (unlike Visual Basic,
which is more object-based -- you use objects and
classes and that's about it). Both Java and C++
support full inheritance, including the ability to
extend the standard class library (a feature
Microsoft will be adding to Visual Basic .Net). C++
supports multiple inheritance, which can be awkward
from a design standpoint in practice. Java has a
clean model with single inheritance BUT supports inner
classes, which can add other specialized behavior to a
set of classes. Java also supports interfaces, a nice
mapping to design patterns in OO design.
Generally, Java and C++ have different strengths
making Java more appropriate for applications and C++
for system interfaces usually. The biggest difference
between Java and C++ is the runtime. Java has a
virtual machine execution environment and a VERY large
standard API library that. Java is USUALLY the better
choice for building applications unless there is a
specific need for C++. It is cheaper, faster to build
normally and the applications have better portability.
C++ can have better performance in some situations
and accesses most operating system API's easily. In
fact, C++ code is often called by Java Native
Interface to perform functions on a specific platform.
==================================
MORE INFORMATION ON THIS TOPIC
==================================
Ask your Web development questions--or help out your peers by answering them--in our live discussion forums.
The Best Web Links: tips, tutorials and more.
|