Full Stack Web Development Internship Program
- 5k Enrolled Learners
- Weekend/Weekday
- Live Class
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.
Metrics | C | C++ | 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.
#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.
#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.
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.
Course Name | Date | |
---|---|---|
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 |
edureka.co