Difference between Java and C

Categories: Core Java C

  1. Java is a platform independent language. But C is not a platform independent is depends on operating system machine.
  2. Java uses both compiler and interpreted, but C is uses compiler only.
  3. Java is object oriented programming language but c language is procedural as well as structured programming language.
  4. In c memory management is manually using malloc( ) and free( ), but java provides a garbage collector to manage memory.
  5. Goto statement is used in c but it not used in java.
  6. In c variable declared in a program beginning of the block and java variable declared anywhere in the program .
  7. Java does not support pointer but c support pointer.
  8. C language is used preprocessor (e.g # define) but java not support prepocessor.
  9. Java does not support operator overloading but c support operator overloading.
  10. Java does not support global variable but c is support global variable.
  11. String is an array of Characters into C .But in case of Java String type is as Object.

Basis

C

Java

Language Level

C is a middle-level language.

Java is a high-level language.

Paradigm

C is a structural and procedure-oriented programming language.

Java is an object-oriented programming language

Approach

It follows the top-down approac

h to design the application.

It follows the bottom-up approach to design the application.

Translation

It is a compiled language.

It is an interpreted language.

Platform Dependency

It is platform dependent.

It is platform-independent.

Keywords

There are 32 keywords in C.

Java has 50 keywords.

OOPs Concepts

It does not follow OOPs concepts.

It follows OOPs concepts.

File Extension

The file is saved with the extension .c.

The file is saved with the extension .java.

Building Block

Function driven.

Object and Class driven.

Comment Style

/ *comment*/

//comment or /*comment*/

Security

It is not secure.

It is fully secured language.

Translation Type

It translates the code into machine language so that the machine can understand the code.

It translates the code into a bytecode that is executed by the JVM.

Pointers

It supports the concept of the pointer.

It does not support the concepts of pointers because of security.

Exception Handling

Exception handling is not present in C language.

Exception handling is present in Java.

Inheritance

It does not support inheritance that is useful for code reusability.

It supports inheritance that provides code reusability.

Threading

There is no concept of threading.

It supports the concept of threading.

Memory Management

It does not maintain memory, internally.

It maintains memory, internally.

File Generation

It generates .exe file.

It generates .class file.

Code Execution

It directly executes the code.

It executes code with the help of JVM.

Call by value/ Call by reference

It supports both call by value and call by reference.

It supports only call by value.

Portability

It is not portable.

It is portable.

Goto Statement

It supports the goto statement.

It does not support the goto statement.

Preprocessors Directives

Preprocessors are supported in C.

Preprocessors are not supported in Java.

Robustness

It is not robust.

It is robust due to strong memory management.

Used For

It is mainly used to develop system applications and firmware.

It is mainly used to develop enterprise applications and web-based applications.

Polymorphism/ Virtual Function/ Operator Overloading

It does not support these features and concepts.

Java supports all these features and concepts.

Popularity

It is less popular in comparison to Java.

It is the most popular programming language.

Top articles
Core Java Indroductions Published at:- Features of Java Published at:- Difference between Java and C Published at:- Difference between Java and C++ Published at:- Advantage and Disadvantage of Java Published at:- What is Java Published at:- Why Java is not Pure Object Oriented Language Published at:- Where and why Java is used Published at:- Java has Following Features Characteristics Published at:- Common Misconception about Java Published at:- 3 most commonly used tools are Published at:- Stream Creation-Jav 8.0(JDK1.8) Published at:- Data Type in Java-Size in Bytes & Bits . Published at:- Operators in Java-Assignment, increment and decrement, equality, arithmetic ,relational , logical, bit-wise, compound assignment Published at:- Java Control Flow of Statements Published at:- Java switch case and conditional operator Selection Statement Published at:- for and while Loop-Java Published at:- Java General Interview Questions and Answer Published at:- Write a program in Java to display the first 10 terms of the following series: 10, 20, 30, 40, …….. Published at:- Write the program in Java to display the first ten terms of the following series: 1, 4, 9, 16, Published at:- Write a program in Java to find the sum of the given series: Published at:- Write a program in Java to find the sum of the given series: Published at:- Why Proxies Are the Silent Backbone of Modern Online Operations Published at:-
R4Rin Team
The content on R4Rin.com website is created by expert teams.