Java/J2EE and SOA (348 Blogs) Become a Certified Professional
AWS Global Infrastructure

Programming & Frameworks

Topics Covered
  • C Programming and Data Structures (17 Blogs)
  • Comprehensive Java Course (4 Blogs)
  • Java/J2EE and SOA (345 Blogs)
  • Spring Framework (8 Blogs)
SEE MORE

What is the difference between C, C++ and Java?

Last updated on Sep 30,2021 54.8K Views

Aayushi Johari
A technophile who likes writing about different technologies and spreading knowledge. A technophile who likes writing about different technologies and spreading knowledge.
8 / 11 Blog from Introduction to Java

Software development has seen transition like any domain out there. This has also resulted in the evolution of programming languages. C, C++, and Java are three languages that have defined programming paradigms with time and yet hold great value in the market. In this article, I will be comparing the differences between C, C++ and Java so you can choose one or more for a probable career or a certification.

Differences between C, C++ and Java

MetricsCC++Java

Programming Paradigm

Procedural language

Object-Oriented Programming (OOP)

Pure Object Oriented Oriented

Origin

Based on assembly language

Based on C language

Based on C and C++

Developer

Dennis Ritchie in 1972

Bjarne Stroustrup in 1979

James Gosling in 1991

Translator

Compiler only

Compiler only

Interpreted language (Compiler + interpreter)

Platform Dependency

Platform Dependent

Platform Dependent

Platform Independent

Code execution

Direct

Direct

Executed by JVM (Java Virtual Machine)

Approach

Top-down approach

Bottom-up approach

Bottom-up approach

File generation

.exe files

.exe files

.class files

Pre-processor directives

Support header files (#include, #define)

Supported (#header, #define)

Use Packages (import)

keywords

Support 32 keywords

Supports 63 keywords

50 defined keywords

Datatypes (union, structure)

Supported

Supported

Not supported

Inheritance

No inheritance

Supported

Supported except Multiple inheritance

Overloading

No overloading

Support Function overloading (Polymorphism)

Operator overloading is not supported

Pointers

Supported

Supported

Not supported

Allocation

Use malloc, calloc

Use new, delete

Garbage collector

Exception Handling

Not supported

Supported

Supported

Templates

Not supported

Supported

Not supported

Destructors

No constructor neither destructor

Supported

Not supported

Multithreading/ Interfaces

Not supported

Not supported

Supported

Database connectivity

Not supported

Not supported

Supported

Storage Classes

Supported ( auto, extern )

Supported ( auto, extern )

Not supported

That’s all with the differences between C, C++, and Java. I hope you are clear with the basic concepts of these wonderful programming languages and helped you in adding value to your knowledge.

Next up, let’ us take a look at some sample program to display the differences between C, C++ and Java.

Sample Program in C, C++ and Java

 

Hello Word Program in C

#include<stdio.h> //header file for standard input output

main() //main method
{
clrscr(); //clears screen
printf(“hello world”); //print statement
getch(); //get the character
}

Explanation: In the above code, you use header file <stdio.h> for standard input output to implement commands like printf and getch.

Hello World Program in C++

#include<iostream.h> // header file for input output
#include<conio.h>
main() // header file for console inout output
{
clrscr(); // clears screen
cout<<”hello world”; //print statement
getch(); // get the character
}

Explanation: In C++, instead you use header file <iostream.h>, <conio.h> for input output and console input output so that you can implement commands like cout and cin. It is similar to printf and scanf in C programming language.

Hello World Program in Java

class edureka // create class
{
public static void main(String args[]) //main method
{
System.out.print(“welcome”); //print statement
}
}

Explanation: In Java, you make use of classes and objects as it is a pure Object-oriented programming language. You call the main function as it is the entry point to your code.

If you found this article on “difference between C, C++ and Java” relevant, Check out the Java Training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. We are here to help you with every step on your journey, for becoming a besides this java interview questions, we come up with a curriculum which is designed for students and professionals who want to be a Java Developer. The course is designed to give you a head start into Java programming and train you for both core and advanced Java concepts along with various Java frameworks like Hibernate & Spring.

Got a question for us? Please mention it in the comments section of this “difference between C, C++ and Java” article and we will get back to you as soon as possible or you can also join our Java Training in Coventry.

Upcoming Batches For Java Certification Training Course
Course NameDate
Java Certification Training Course

Class Starts on 29th April,2023

29th April

SAT&SUN (Weekend Batch)
View Details
Java Certification Training Course

Class Starts on 27th May,2023

27th May

SAT&SUN (Weekend Batch)
View Details
Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

What is the difference between C, C++ and Java?

edureka.co