What is difference between C++ and Java?

Asked by Last Modified  

13 Answers

Follow 0
Answer

Please enter your answer

Expert in IT

The main difference is that C++ is object oriented and JAVA is purely object oriented language. Which means even though C++ follows OOPS concept it also have some features that violate the OOPS concept, such as pointers, operator overloading etc. But JAVA do not support any of these feature that...
read more
The main difference is that C++ is object oriented and JAVA is purely object oriented language. Which means even though C++ follows OOPS concept it also have some features that violate the OOPS concept, such as pointers, operator overloading etc. But JAVA do not support any of these feature that violate OOPS concept. read less
Comments

Tutor

Let me tell you what exactly is the difference . When you compile a c++ source code it gets converted to an executable code. This executable code that is generated contains instruction set specific to the particular system architecture (i.e 32 bit or 64 bit) and particular Operating system calls. But...
read more
Let me tell you what exactly is the difference . When you compile a c++ source code it gets converted to an executable code. This executable code that is generated contains instruction set specific to the particular system architecture (i.e 32 bit or 64 bit) and particular Operating system calls. But in-case of java , when you compile a java source code it gets converted as byte code which independent of any system architecture or native operating systems calls. Jvm is os dependent and when your class file goes through jvm it gets converted as native machine code. read less
Comments

IT Professional Trainer working with a reputed Institute. Headquarters: Hyderabad

C++ can be used as a conventional programming language; it also supports Object Oriented Programming. So we can call it as Hybrid Programming Language. But JAVA is a fully Object Oriented Programming Language suitable for creating Web Application / Website etc.
Comments

Both are object oreinted programming languages, but java is said to be purely object oriented pgmng language. In C++ it use compiler for debugging.but java is both compiled and interpreted, and java is used in network based applications, its a highly secured language too and machine independent is...
read more
Both are object oreinted programming languages, but java is said to be purely object oriented pgmng language. In C++ it use compiler for debugging.but java is both compiled and interpreted, and java is used in network based applications, its a highly secured language too and machine independent is other feature of java. read less
Comments

c++ and java both are object oriented. the difference is c++ is possible without using class but java is only on based on class.
Comments

Both Java and C++ support object oriented programming, yet there are differences between them. To begin with, Java is a pure object oriented programming language; therefore, everything is an object in Java (single root hierarchy as everything gets derived from java.lang.Object). On the contrary, in C++...
read more
Both Java and C++ support object oriented programming, yet there are differences between them. To begin with, Java is a pure object oriented programming language; therefore, everything is an object in Java (single root hierarchy as everything gets derived from java.lang.Object). On the contrary, in C++ there is no such root hierarchy. C++ supports both procedural and object oriented programming; therefore, it is called a hybrid language. read less
Comments

Technical and Soft Skills Training on 35+ Subjects

The following three links nicely explain the differences between Java and C++: 1) http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B 2) http://cs-fundamentals.com/tech-interview/java/differences-between-java-and-cpp.php 3) http://www.dickbaldwin.com/java/Java008.htm
Comments

IT Professional Trainer with 15 years of experience in IT Industry

Both Java and C++ support object oriented programming, yet there are differences between them. Differences are: 1. Java does not support pointers, templates, unions, operator overloading, structures etc. But C++ supports structures, unions, templates, operator overloading, pointers and pointer arithmetic....
read more
Both Java and C++ support object oriented programming, yet there are differences between them. Differences are: 1. Java does not support pointers, templates, unions, operator overloading, structures etc. But C++ supports structures, unions, templates, operator overloading, pointers and pointer arithmetic. 2. Java support automatic garbage collection. It does not support destructors as C++ does. 3. Java does not support conditional compilation and inclusion. Where Conditional inclusion (#ifdef #ifndef type) is one of the main features of C/C++. 4. Java has built in support for threads. In Java, there is a Thread class that you inherit to create a new thread and override the run() method. But C++ has no built in support for threads. C++ relies on non-standard third-party libraries for thread support. 5. Java doesn't provide multiple inheritance, at least not in the same sense that C++ does. C++ does support multiple inheritance. The keyword virtual is used to resolve ambiguities during multiple inheritance if there is any. read less
Comments

Passout from IIITb, Worked in many countries.

There are number of difference between java and C++ + less memory models Java allocates all its objects on the heap (all managed by the garbage collector); C++ additionally offers stack based instantiation (including temporary objects), and static instantiation. Stack objects are automatically deleted...
read more
There are number of difference between java and C++ + less memory models Java allocates all its objects on the heap (all managed by the garbage collector); C++ additionally offers stack based instantiation (including temporary objects), and static instantiation. Stack objects are automatically deleted (when they go out of scope), so a programmer has to assure no references are kept further (e.g. in a container, registry, etc.). Instantiation order with static instantiation is difficult to predict, and therefore error-prone, less portable, and restricted. + no temporary objects [Based on non-trivial rules] C++ language will chose either a cast or temporary object (including object construction) to [implicitly] coerce one type into another, sometimes leading to unwanted effects or unwanted overhead. + no copy constructor and assignment operator needed Due to Java's memory model, no copy constructor and assignment operator are needed, and therefore can't become a source of bugs. + no explicit cast code supported C++ increases the number of routes for type coercion by allowing to defined explicit cast code. + no ambiguity between int, boolean, and null pointer Due to false and null both being distinct from 0 there's no ambiguity if used e.g. as parameters in overloaded methods3. + no default parameters As not supported, there can't be an ambiguity between methods with default parameters and other overloaded methods. + no unsigned integers As unsigned integers don't really buy anything (in C/C++ neither, decent casts can be used), they're omitted. ~ const not supported Object immutability is in Java at most considered via annotation4. The more intuitive final modifier allows to implement first-level constness on variables and fields (again being more intuitive than C++'s reference fields). ~ expression evaluation order Evaluation order within expression is stricter defined in Java, leading to more deterministic behavior, and avoiding a specific source of problems. C++ compiler however may allow options to warn about undefined semantics outside of sequence points. ~ no macro pitfalls Macros offer call-by-name semantics and therefore allow unwanted side effects, e.g. with multiple evaluation (max(i++,j++)), or precedence issues (with missing parentheses).5 read less
Comments

IT Professional Trainer and Mentor with 25+ Years Experience in Corporate and Technology Training

C++ and Java both are Object oriented programming languages. C++ is used for system side programming and Java is used for application development. C++ supports pointer and java will not support pointers.
Comments

View 11 more Answers

Related Questions

How do I get 6 power 13 in c language?
In the C programming language, you can calculate the power of a number using the pow() function from the <math.h> library. To find 6 raised to the power of 13, you would write a C program that includes...
Raju
0 0
6
what is the significance of lvalue?
An lvalue (locator value) represents an object that occupies some identifiable location in memory (i.e. has an address).
Abhishek
What is the best IDE for C and C++ development?
If you're a student then Turbo C++ is best for C and C++ program + inbuilt C/C++ Graphics Function If you're a professional or working then Netbeans for C/C++ or Code:: Blocks is Best.
Balakrishnasingh
What is the structure of a C program?
A basic structure of a C program typically consists of: 1. **Preprocessor Directives:** These are lines of code that begin with a `#` symbol. They are instructions to the compiler to include certain...
Snehal
0 0
5
Why are operating systems written in C? Why aren't other languages used?
low-level access to hardware, performance, and historical reasons.
Chandramami
0 0
5

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Built-In Functions (Python)
Built-in Functions: The Python interpreter has a number of functions built into it that are always available. They are listed here in alphabetical order. Built-in Functions abs() divmod() input() open() staticmethod() all() enumerate() int() ord() str() any() eval() isinstance() pow() sum() basestring() execfile() issubclass() print() super() bin() file() iter() property() tuple() bool() filter() len() range() type() bytearray() float() list() raw_input() unichr() callable() format() locals() reduce() unicode() chr() frozenset() long() reload() vars() classmethod() getattr() map() repr() xrange() cmp() globals() max() reversed() zip() compile() hasattr() memoryview() round() __import__() complex() hash() min() set() ...

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

C #-Program Sample Application
//using system namespace using System; //Namespace declaration namespace first{ //Class declaration class helloworld { //Main method public static void Main() { //Statement to print output on console...

Pointers and References
Are reference and pointers same? No. I have seen this confusion crumbling up among the student from the first day. So better clear out this confusion at thevery beginning. Pointers and reference...

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Recommended Articles

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Looking for Programming Languages Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you