3 Mins Read

Battle of the titans: Comparing C, C++, Java and Python

Voiced by Amazon Polly

Introduction

Programming languages are tools that are used by the humans to communicate with computers and get their work done. From a simple data analysis to powering a robot, all of these actions are done by coding using programming languages. There have been many programming languages available in the market and some of them had a very limited lifetime and some are in the industry for over 50 years now. Let us take time to understand some fundamental differences between the major programming languages that have been in the market starting with C,C++, Java and Python. We will first get to know the purpose of each of these programming languages and also understand some fundamental differences.

C : C programming language was developed by Dennis Ritchie in the year 1972. It is a very powerful, middle level programming language used specifically for system programming and embedded systems.

C++ : C++ was developed by Bjarne Stroustrup in the year 1979 and it is a object oriented programming language with powerful features. It is used for game development and high performance applications.

Java: Java was developed by James Gosling in the year 1991. It is a very versatile, platform independent programming language. It is used extensively for web development and app development.

Python : Python was developed by Guido Van Rossum in the year 1991. Over the years, the programming language’s popularity has grown extensively and it is used a lot nowadays for data science, automation, implementing machine learning and even web development.

Freedom Month Sale — Upgrade Your Skills, Save Big!

  • Up to 80% OFF AWS Courses
  • Up to 30% OFF Microsoft Certs
Act Fast!

 

 

S.NO C C++ JAVA PYTHON
1. Structured programming language Object-oriented programming language Object-oriented programming language Object-oriented programming language
2. Compiled Compiled Compiled & Interpreted Interpreted
3. 32 keywords

Eg:- case, char

60 keywords

Eg:- class, protected

50 keywords
Eg:- interface, extends
36 keywords

Eg:- False, None

4.
Rules for naming identifier Rules for naming identifier Rules for naming identifier Rules for naming identifier
Should begin with an alphabet Should begin with an alphabet It can begin with the alphabet, underscore, or dollar symbol. But cannot begin with a number Should start with an alphabet or underscore.
Can have numbers, underscore Can have numbers, underscore Keywords cannot used as identifiers Should not contain white spaces.
Can be a combination of alphabets, numbers or underscore
Keywords cannot used as identifiers Keywords cannot used as identifiers Keywords cannot be used as identifiers
5. Comments:- /*….*/ (multi line comment), //(single line comment) Comments:- /*….*/ (multi line comment), //(single line comment) Comments:- /*….*/ (multi line comment), //(single line comment), /** …. */(documentation comment) #- Single line comment
“””-Triple quotes – multi line comment
6. Data types :- int, char, float, double, void Data types :- int, char, float, double, void Data types:-
byte, short, int, long,
float, double,char, boolean
Data types:-
String,integer,float,complex,list,tuple,range,dictionary,set,frozenset,Boolean,bytes,

bytearray,memoryview,None

7. Bitwise shift operators are : >>(right shift),<<(left shift) Bitwise shift operators are : >>(right shift),<<(left shift) Bitwise shift operators are : >>(right shift),<<(left shift),>>>(triple right shift operator) Bitwise shift operators :
>> ( right shift )
<< (left shift)
8. Char is 8 bits wide Char is 8 bits wide Java uses Unicode to represent characters. It is 16 bits wide. No character data types. Character is simply a string of length 1
9. Preprocessor directives allowed
Eg:- #include,#define
Preprocessor directives allowed
Eg:- #include,#define
No preprocessor directives No preprocessor directives
10. Variables need not be initialized before using it Variables need not be initialized before using it Variables must be initialized before using it No explicit declaration of variables. We can start using it after initialization.
11. Array should be declared mentioning its size
Eg:- int num[10
Array should be declared mentioning its size
Eg:- int num[10
Arrays are declared without mentioning its size.
int num[];
num=new int[10] (or)
int num[]=new int[10];
Use lists
Use array module
Use numpy module
12. Explicit string data type not available Explicit string data type not available String data type available in java. It is a class String data type available
13. Supports pointers Supports pointers Does not support pointers Does not support pointers directly
14. Structures and unions available Structures and unions available Structures and unions not available Structures and unions not available
15. Supports operator overloading Does not support operator overloading Supports operator overloading
16. Programs can be written in c++ without using a class All the code in java program needs to be written in one or more classes
17. Global variables and functions are allowed Global variables and functions are allowed No global variables or functions Allowed to create global variables
18. Allows default arguments in functions Not allowed in java Support for default argument
19. Supports multiple inheritance Multiple inheritance not supported Yes. Supports multiple inheritance
20. Supports constructors and destructors Supports constructors and destructors Supports constructors and destructors
21. Supports typedef Supports typedef Does not Supports typedef
22. Unsigned integers can be declared Unsigned integers can be declared No unsigned integers No need to specify any data type at all.
23. Allows goto Allows goto Does not allows goto Does not allows goto
24. delete operator available No delete operator del keyword is used to delete objects
25. Objects may be passed by value or by reference Objects are passed only by reference in Java Uses Pass by Object reference

 

Freedom Month Sale — Discounts That Set You Free!

  • Up to 80% OFF AWS Courses
  • Up to 30% OFF Microsoft Certs
Act Fast!

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, and Google Cloud Platform Partner, CloudThat has empowered over 850,000 professionals through 600+ cloud certifications winning global recognition for its training excellence including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 12 awards in the last 8 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, IoT, and cutting-edge technologies like Gen AI & AI/ML. It has delivered over 500 consulting projects for 250+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

WRITTEN BY Vani Chakraborty

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!