Skip to main content

Difference between C and Java ,C++ and Java

Hello Friends
I am Kushal Bhatt.
And I am welcome you on our blog CompuTech with another topic.

Today's topic is Difference between C and Java ,C++ and Java.
First we discuss Difference between C and Java.


1. C was develop by Dennie Ritchie at AT&T Bell Labs between 1969 to 1973,
On other hand Java was develop by James Gosling at sun Microsystems which first appear in 1995.

2. C is Procedural Oriented Programming language
On other hand Java is Object Oriented Programming language.

3. C is Low level language
On other hand Java is High level language.

4. C is Compile language
On other hand Java is Interpreter Language.

5. C follow Top Bottom approach.
on other hand Java follow Bottom Top approach.

6. C contains the Preprocessor Directives header file like #include,#define.
On other hand Java not contains any header file.

7. C support Goto statement, Structure,union but Java not support Goto statement,Structure,union.
8. C support the keyword like typedef and enum on other hand Java not support typedef and enum.

9. C cannot support Class, inheritance, polymorphism,objects etc concepts.
On other hand Java support all Object Oriented Concepts.

10. C support Pointer but Java not support Pointer/explicit Pointer.

11. C use library malloc and free for memory management.
On other hand Java use Garbage Collector for memory management which automatically invoke whenever require.

12. C not support Method Overloading.
On other hand Java support Method Overloading.

13. C has no mechanism to handle errors when it occurred.
But Java has Exception Handling.

14. C is not portable but Java is Portable.

15. C 's compile time faster then java is  slide slower then C because it covert first source code to byte code and then byte code convert to machine code that why it make java portable .

So this all about difference between C and Java


Now we understand main difference between C++ and Java.

There are major thing is both are Object Oriented languages so there difference make on some functionality support or not support by respective language.

1. C++ develop by Bjarne  Strousstrup in 1979 when he do PHD thesis and use Simula Language which is Object Oriented languages but very low language for practical use.
And Java develop by James Gosling at sun Microsystems which first appear in May 1995.

2. C++ is support header file like #include,#define but Java not support header files.

3. C++ support Pointer, union, structure,Pointer arithmetic and Goto statement.
On other hand Java not support union, structure,Pointer arithmetic and Goto statement but Pointer replace by call of reference.

4. C++ support multiple inheritance but Java not support multiple inheritance but it replace by Interface.

5. C++ is not Platform independent while Java is Platform independent.

6. C++ use Destructor function but Java use Finalize method invoke garbage Collector for destroy object.

7. C++ support both Method Overloading and Operator Overloading. While Java support only method overloading but not support Operator Overloading.

8. C++ support Virtual keyword but Java not support Virtual Keyword for make method virtual.

9. in C++ is support Template class but Java not support Template Class.

10. C++ not support Document Comment but Java support Document Comment (/* ...*/).

11.  in C++ not support finally block but Java support it for Exception handling.

12. in C++ has not support built in thread but it can use third libraries.
On other hand Java has built in thread support.

13. in C++ support Scope Resolution Operator(::) because it allow to defined method outside class
While Java not support Scope Resolution Operator(::) because it not allow method declaration outside class.

So this are major differences are discussed in this blog but there are some differences are can't covered but that not affect you code.
Thank you for read my blog if you like and found important then please share it .

Comments

Popular posts from this blog

Features of java for beginners

Hello friends I am kushal bhatt And I am welcome you on my another post on java subject in our blog CompuTech. Today We need to discuss the key features provided by java . So lets start our todays topic Java is very high level programming language and its also support oops concepts that make it more better. There are list of features provide by java 1.Simple and Familier 2.Object Oriented. 3.Robust and Secure. 4.Plateform Independent and portable. 5.Compiled and Interpreter. 6.Distributed. 7.Multithreading and Interactive 8.High Perfomance. 9.Dynamic and Extensive. 1. Simple and Familier: -             Java are not use some of features such as Operator overloading,Multiple Inheritence,Goto statement , pointer, Preprocessor Directive and many more features which is helpful to reduce complexity of program. Java is quite similar to C and C++ even though Java syntax similar to C and C++. So it is easy to unde...

Basic Introduction of Java for beginners

Hello Friends I am kushal bhatt and I am welcome you on our very first  blog CompuTech . Friends, you all are already aware about a Java Programming Language like how to write a code how to compile and run it but i am here to discus about . Why Java was invented. Which requirement fulfilled by Java and Nowadays Where actually java is used in a real time . So it is very required for your career to clear basic fundamental of java . So lets start our todays topics☕ First of all we need to clear what is actual java is? Java is a System friendly High level programming language that means java can easily interact with system. Java is a pure Object Oriented Programming language because everything in java must be object or class . History :- Java was Developed by James Gosling at sun microsystems in 1990  and after couple of years it acquire by Oracle corporation till now. Sun microsystem actually want to develop a language that can easily work with e...