what is the difference between c and java?
Hello,
I am last year S.Y.B.Sc.IT student. I am new to programming language. I have just started learning java. Yesterday our sir has given us assignment in which there is one question like write the difference between c and java.. I only able to write only 2 difference. If you have any more difference then please give it me.
Re: what is the difference between c and java?
1.C is not object-oriented programming language where as Java is pure object-oriented programming language.
2.java language support Polymorphism, Classes, Inheritance, Objects while C language does not support these concepts.
3.Execution of a program in java language is non-linear where as execution of a program in C language is linear.
4.In java language you can not write program without class & object while in C language you can write program with class & object.
Re: what is the difference between c and java?
- In C language we use pointers while in java language we don't use pointers.
- Java language is object oriented language while C language based on structures.
- Java language use process Garbage Collection for managing memory automatically while in C language you have to manage memory manually.
- Execution of program in Java language is very slow compared to C language.
Re: what is the difference between c and java?
*In C language you have to declare all variables in the beginning class while in java language you can declare variables anywhere in a program.
*In C language you can use go to, union and struct statement in program where as you can not use these statement in Java language.
*In Java language members are by default private where as In C language members are by default public.
Re: what is the difference between c and java?
- In Java language we can not use global variable for accessing all other functions while in C language we can use the global variable.
- Java language does not supports multiple inheritance where as C language supports it
- Java language does not support Templates where as C language supports it.
- Java language does not support Operator overloading while C language supports it.
Re: what is the difference between c and java?
- preprocessors like # defines and # include are used in C language where as java language does not support these preprocessors
- Java give more importance to data rather than procedure while C give much more importance to the procedure rather than data
- In Java language you can not use pointer while in C language you can use pointer.
- c gives more importance to the procedure and less to the data but, where as c++ & java give more importance to the data .