Java and C++ are the most popular Programming Languages Worldwide. Although Java is newer, still it has managed to gain immense popularity. Both of these languages have wide variety of applications and have become an important part of the Cyber world.
If you are not familiar with both these programming Languages, and are confused with which one to start with, then I would recommend that you learn C first, and then you can dive into OOPs either with Java or C++, depending on your requirements, which the rest of this post will explain.
For those who are already familiar with both or one of these languages, must be here to see if they really picked up the right language. Let’s Find Out.
C/C++ is Faster than Java, always. This is simply because the when we compile a Java Program all the Classes have to be loaded first and then the program is compiled. Secondly, JVM(Java Virtual Machine), is itself written in C. So, its Obvious that C or C++ programs will run/compile quicker than a Java Program. This difference becomes insignificant in case of Larger Applications or Softwares.
So, if you are thinking of participating in a Programming Competition, you do not want to use Java.
The Performance of both these Languages is excellent. Isn’t it obvious, for such hugely popular languages. If you pick up any of these languages you won’t face any performance issues at all. C/C++ and Java are both sufficiently old languages, and are being constantly updated with more and more features/functions and while debugging the bad ones.
Java and C/C++ have wide variety of applications. And this is what you should consider while choosing which language to pursue between Java and C++.
If you are Looking to Build Softwares for Windows or any Operating System, Java is a much better Language to use. Mainly, Because of its Portability. Your single Java Code/Application will run in all Operating Systems(Windows, Mac, Linux) without making any major changes in the code. Java Also offers many Exciting GUI libraries which are easy to use and help you build some exciting user interface for your applications.
Android Applications are written in Java. There is nothing there for C/C++ Developers. So, if Android Development is a part of your plan you should really dive into Java.
Although, the Newer Windows Phones and iOS 6 use C# and Objective-C. But, if you are a C++ Developer there are certain provisions for you too as well. But, You won’t be able to do much with C++. So, it will be better to learn the respective languages(C#, O-C) instead.
Server Side Programming/Website Developement
You can do the Server side Programming for a Website with both Java and C++. Although, Java is more popular and you will find more support for it. Whenever you see a website which uses .jsp as extension for most of their pages, you should conclude that its server-side is programmed in Java.
But, for Other Server Side Processes which do not directly affect your websites front-end, C++ is better recommended due to its speed for smaller applications. Google uses a lot of C++ for its Search Algorithms.
Btw, PHP is the Most Popular Server Side Languages with over 60-65% Websites using it.
If you are into Development of Operating system, I do not really mean, writing your own Os. But, if you like to get into the core of Linux, or build Linux applications or derive/build your own OS based out of Linux, then C++ is going to be of Great Help. Being able to do this might land you really good jobs, probably as a Server Administrator at a Web Hosting Company. 😛
You can never Build an Operating system purely with Java. But it is possible with C or C++.
C++ and Java both are Good languages for Game Development. But, I feel Python will overtake both these languages at a later time as a preferred language for Game Dev. Most Games for PC, are written in C/C++. Mobile Games are Generally Written in Java. Complex Games for Consoles are Also written in C/C++. Your Games like Call of Duty, Modern Warfare, etc are all C++.
But, the Main Component of a Game Development is a Graphics Library(e.g OpenGL) and not the Programming Language. So, if you are willing to do Game Development, you should pick up C++ or Java(anyone) and also learn using OpenGL. Support for OpenGL is available with most programming languages, including Java & C++. But, if You choose Java your games can be easily ported on Android which is the most popular Gaming Platform for Handheld Devices.