English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i heard that Java and C++ is similar . if u do one of them then dont have to learn the other . So what i would like to know is,
are both of those similar programming with same function or performs different functions?

2006-09-19 15:17:20 · 4 answers · asked by balckdevil007 2 in Computers & Internet Programming & Design

4 answers

Java and C++ have many structural similarities since both are Object Oriented (OOP) programming languages. The is however a major fundamental difference between the two. C++ programs are compiled into binary code and run directly by the operating system of the computer. Java programs on the other hand, must be interpreted by an add-on piece of software called the Java rintime environment or Java Virtual Machine, which must be installed on a computer in order for it to run a Java program. You can see an example of a Java program in action and watch the Java Virtual Machine starting up at http://www.toucanmultimedia.com under the WebPen link.

2006-09-19 15:51:16 · answer #1 · answered by gabacho 1 · 1 0

I agree with the above though syntax ease is more based on what you are used to, I think. C++ might create a faster executable but this is questionable and derives mainly from the compiler. Plus I don't recall making too many Java executables (applications) but mainly applets; this may be my inexperience with Java though. Other differences are semantics and program language design. Java was design for/around the web environment whereas C++ was C with add-ons (in my humble opinion). Some of Java's OO functionality is not quite as "open" as in C++ such as C++ use of multiple inheritance (i.e. multiple indirections) with Java's more easily manageable and debuggable inheritance structure. There are probably more but I'm not too keen on Java preferring C and certain functional languages. Cheers!

2006-09-19 16:09:41 · answer #2 · answered by Christina 2 · 0 0

Java is meant to run on a virtual machine, meaning your exeucable will run on any platform. C++ programs are hard coded to the platform they were developed on.

In terms of syntax, Java encapsulates things into objects much more than C++. In java, everything is an object, and that is partly due to the fact that it does have to run in a virtual machine and it must all be allocated on the heap.

As a whole new language had to be invented, they just based it off C++ but took out some of it's outdated semantics. If you know one, you can pick up the other easily, but you cannot use them in the same way. Its like driving a car or driving a bumper car. If you can drive one you can drive the other but they have different purposes.

2006-09-19 17:33:41 · answer #3 · answered by soulblazer28 2 · 2 0

Java syntax is much more easier

2006-09-19 15:25:09 · answer #4 · answered by Yang Guo 2 · 0 0

fedest.com, questions and answers