answersLogoWhite

0


Best Answer

Java is pure object oriented programming language than c++, it uses the concepts of Classes, Objects, Inheritance, Polymorphism. And the execution of a program is non-linear.

Java's motto (so to speak) is "write once run anywhere".

When you compile a Java program, an intermediate bytecode is generated, which itself is interpreted by the Java Virtual Machine. This way you write a program once, and the virtual machine translates the bytecode into instructions a specific processor can understand. Execution of a Java program is by consequence a bit slow, because the intermediate bytecode has to be interpreted.

Java uses a "Garbage Collector" which manages memory automatically so the programmer doesn't have to handle that.

Variables in Java can be declared anywhere in a program. (Although it is recommended to declare/define them at the beginning of blocks).

Reuse of code achieved by inheritance.

By default members are private.

During the execution of bytecode by JVM, it does not substitute the entire classes of package which are imported in the program. It just enters the package and executes the class and returns result in to the program. Due to this less memory is used by java program.

C

  • C uses concept of structures (not object oriented).
  • In C we use the concept of pointers whereas there are no pointers used in JAVA
  • In C the programmer needs to manage memory manually. "malloc()" and "free()" are the fundamental memory allocation library calls.
  • In C the declaration of variables should be on the beginning of the block.
  • C supports go to statement, struct and union unlike Java
  • C is compiled to the machines "native language" so it's execution is much faster than Java's.
  • No reuse in code and by default members are public.
  • C programs will have a larger memory footprint than an equivalent program written in pure machine code, but the total memory use of a C program is much smaller than the a Java program because C does not require the loading of an execution interpreter like the JVM.
  • The main differences between Java and C are speed, portability, and object-orientation.

Difference between class and structure:

In class,We can declare and define data members and member functions.But in Structure we can declare variables and functions.

JAVA:

Java was created for the purpose of making a language that could be implemented on many different types of computers (cell phone, mac, PC, linux, etc.) C on the other hand can only be run on a computer of the same type as the one that compiled the program.

One of the costs of this portability in Java is speed. On numerous benchmarks Java still lags behind C in terms of speed, but that gap is narrowing.

Java is also object-oriented, whereas C is not. Java allows a user to create classes that contain data and methods. C is not capable of doing that.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

C is the procedural based language i.e. it follows top down approach of programming

while java is purely object oriented language it has main features like class ,object,inheritance,polymorphism,abstraction ............

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between programming languages Java and C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between java and object oriented programming?

java is a programming language/platform that embodies object oriented programming concepts. The question of what is the difference is like asking what is the difference between cars and a Volvo.


What is difference between c and oops?

C is a programming language, oops is what you say when you realize you were wrong in something. Note: Some programming languages are known as object-orient languages, C is not one of them, but some derivatives of it (C++, C#, Java) are.


Which is the best software course java or software testing?

java if u interested in programming languages ! testing if u not interested in programming languages !


Why java is 100 percent programming language?

There are no 'partial' programming languages.


What is the difference between c plus plus and java programming?

Java doesn't have pointers. C++ has pointers.


What programming language are java applets written in?

Java applets are written in the Java programming language. Java is considered to be one of the oldest and most commonly used programming languages in the world.


What is the difference between Windows and Java?

Windows is an operating system whereas Java is a programming language. They are entirely different.


What is the difference between java and internet?

The Internet is a world-wide computer network. Java is a computer programming language.


Difference between java and C plus plus?

java is an advanced object oriented programming language than c++


Why you need java programming?

You don't. There are hundreds, nay thousands, of programming languages, Java is just one of them. Programming languages are used to make computer programs (software); software is basically what makes computers work.


What in computing is java python and c?

They are all programming languages.


What are the features in java that makes it similar to C programming?

Java is not similar to C. Java is, however, similar to C++. Both C++ and Java are object orientated programming languages (OOPL's).