“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
java has no unions java is more flexible java is smaller, simpler and more reliable java supports only single inheritance java provides relatively simple form of concurrency java uses implicit storage deallocation for its heap-allocated objects
no operator overloading in java…. no multiple inheritance…… java is interpreted language garbage collection happens in java more object oriented than C++… as even the main function is also in a class….
1>Platform Independent : Java code is said to be a multiplatform code and can run on any platform because after the compilation of the source code byte code(s) are created rather than a binary code so it can run on any platform which supports JVM concept but on the contrast at time(s) it slows down the application tremendously
2> Garbage Collection : Java handles freeing up of the memory but this is not guranteed since the GC thread has the lowest priority
3>Operator Overloading : is not provided in Java,but what are the advantages of Operator Overloading but one may question what are its advantages, well it makes a more readable and a modular code. In c++ cin and cout objects can also be overloaded which again leads to a better readability and flexibility
4> Multiple Inheritance : Java does provide multiple inheritance in form of Interfaces, In Java a class can not inherit from more than one class but it definitely can implement any number of interfaces
5> Templates: in c++ give such a lot of flexibility and avoids redundant coding which again is not provided by Java
Well, I don’t agree with java not having Templates like C++. Actually java does provide that feature with a different name, we can get the same feature using wrapper classes in java.
Ressources management is done with the dispose-pattern (try-finally)(determinist) and the garbage collector (not really determinist) in Java. In C++, it can be done by hand, but RAII is preferred (determinist).
In Java, when handling instances of user defined types, we handle them as entities. C++ enable us to handle them as value as well. IMHO, don’t look elsewhere for reasons to not having operators overloading in Java. It hardly makes sense with entity semantics.
In Java, we cannot use contract programming nativelly — as interfaces have no code associated. We have to relly on neat external preprocessors.
Java comes with a VM. A rich library. Specifications regarding threading, GUI, networks, reflection, …
Differences in exceptions specifiations.
Java containers are based on inclusion polymorphism: every thing derives from an Object root class. C++ containers are based on parametric polymorphism. Even primitive types can be used as element type.
No free functions in Java. They are static and public.
There are differences in the way both langages evolve. ISO/ANSI standardisation commitee on one side, and almost no money invested. Companies are backing the other.
in java main() is written in class itself. no need to mention the packages compulsorily and java is internet based language. does not supports operator overloading and no virtual functions and no structures and no unions.
more it is paltform independent
java has no unions
java is more flexible
java is smaller, simpler and more reliable
java supports only single inheritance
java provides relatively simple form of concurrency
java uses implicit storage deallocation for its heap-allocated objects
no operator overloading in java….
no multiple inheritance……
java is interpreted language
garbage collection happens in java
more object oriented than C++… as even the main function is also in a class….
1>Platform Independent : Java code is said to be a multiplatform code and can run on any platform because after the compilation of the source code byte code(s) are created rather than a binary code so it can run on any platform which supports JVM concept but on the contrast at time(s) it slows down the application tremendously
2> Garbage Collection : Java handles freeing up of the memory but this is not guranteed since the GC thread has the lowest priority
3>Operator Overloading : is not provided in Java,but what are the advantages of Operator Overloading but one may question what are its advantages, well it makes a more readable and a modular code. In c++ cin and cout objects can also be overloaded which again leads to a better readability and flexibility
4> Multiple Inheritance : Java does provide multiple inheritance in form of Interfaces, In Java a class can not inherit from more than one class but it definitely can implement any number of interfaces
5> Templates: in c++ give such a lot of flexibility and avoids redundant coding which again is not provided by Java
Well, I don’t agree with java not having Templates like C++. Actually java does provide that feature with a different name, we can get the same feature using wrapper classes in java.
Ressources management is done with the dispose-pattern (try-finally)(determinist) and the garbage collector (not really determinist) in Java. In C++, it can be done by hand, but RAII is preferred (determinist).
In Java, when handling instances of user defined types, we handle them as entities. C++ enable us to handle them as value as well. IMHO, don’t look elsewhere for reasons to not having operators overloading in Java. It hardly makes sense with entity semantics.
In Java, we cannot use contract programming nativelly — as interfaces have no code associated. We have to relly on neat external preprocessors.
Java comes with a VM. A rich library. Specifications regarding threading, GUI, networks, reflection, …
Differences in exceptions specifiations.
Java containers are based on inclusion polymorphism: every thing derives from an Object root class. C++ containers are based on parametric polymorphism. Even primitive types can be used as element type.
No free functions in Java. They are static and public.
There are differences in the way both langages evolve. ISO/ANSI standardisation commitee on one side, and almost no money invested. Companies are backing the other.
Plus many more differences.
in java main() is written in class itself. no need to mention the packages compulsorily and java is internet based language. does not supports operator overloading and no virtual functions and no structures and no unions.
more it is paltform independent
Leave an Answer/Comment