Solved

difference between Java and C++

Posted on 2011-02-28
7
796 Views
Last Modified: 2012-05-11
I am currently learning Java and I already know  C++.  the book I am reading said Java  is missing some of the harder components of C++.  Does anyone know what these are?  I might not know how to use them in C++ either but I'd like to know what they are.
0
Comment
Question by:dwcronin
  • 4
  • 2
7 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 400 total points
Comment Utility
One thing which is often mentione is that Java does not support
operator oveerloading supported by C++ - this is the feature which allows
to provide special menaing to such oprators as +, -, etc, within certain classes
These sometimes make reading C++ program difficult

The most obvious thing is that Java does not support pointers - they may also sometimes
be difficult to understand.

Also java requires all code to be within classes. In C++ you may have codes
outside any classes. In this way Java becomes
more organized.  

Therefore it is easier to understand Java code, on the other hand C++
can be more flexible.

Of course one can find some papers about the differences; these are just thisng which come
up perhaps most often.



0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility


There is below sectooion C++ concepts missing in Java;
http://www4.ncsu.edu/~kaltofen/courses/Languages/JavaExamples/cpp_vs_java/
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 400 total points
Comment Utility
Yes, also important thing which makes java easier - is that it does not allow multiple inheritance -
class can  have only one superclass
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 47

Expert Comment

by:for_yan
Comment Utility
And this page also has a few interesting points on this subject from the point of view of C++ programmers:
 
http://www.programmersheaven.com/mb/CandCPP/237865/237875/re-from-c++-to-java/?S=B20000
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 100 total points
Comment Utility
Java's garbage collection removes the memory leak issue to a large degree.
Java does not support multiple inheritance which can cause problems if not careful. Instead, they emulate the C++ abstract class interface.
Java does not support pointers or pointer arithmetic, which is often tricky to use in C++ (although convenient).
Java's code is more portable than C++ code. Unfortunately, there are so many releases of Java per decade that a currently built program may not run on an older JVM.

Here is a list of differences:
   http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B

0
 
LVL 32

Expert Comment

by:phoffric
Comment Utility
I didn't see any previous posts, so there appears to be repetition.
0
 

Author Closing Comment

by:dwcronin
Comment Utility
thank all of you.  You guys were very fast!
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now