Hello Friends
I am Kushal Bhatt.
And I am welcome you on our blog CompuTech with another topic.
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.
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.
On other hand Java is Object Oriented Programming language.
3. C is Low level language
On other hand Java is High level language.
On other hand Java is High level language.
4. C is Compile language
On other hand Java is Interpreter Language.
On other hand Java is Interpreter Language.
5. C follow Top Bottom approach.
on other hand Java follow Bottom Top 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.
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.
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.
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.
On other hand Java support Method Overloading.
13. C has no mechanism to handle errors when it occurred.
But Java has Exception Handling.
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.
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.
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.
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.
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 .
Thank you for read my blog if you like and found important then please share it .
Comments
Post a Comment