Java or C++? Is one better? Or do they just have different applications? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Java or C++? Is one better? Or do they just have different applications?

I am a C++ novice who just completed the SoloLearn course on the subject, and now I am just starting the Java course. So far it seems to do a lot of the same stuff, except more platforms run programs built with Java. For example, Android devices. So is Java just an all around better language for me to focus on learning?

24th Jul 2017, 7:28 AM
Boo Da Man
Boo Da Man - avatar
2 Answers
+ 4
@Shobhit - So basically, you need JRE installed on whatever you are running a java program on, and some things can't use JRE, like microcontrollers? I remember messing around with an arduino controller years back that I think used C#. so that all makes sense. so can cpp build programs for different operating systems if it's compiled differently? I mean, not every system, but lets say, one compilation of a program for windows, and another compilation of the same program for Mac? I think I'm gonna be compiling... ANOTHER QUESTION! lololol
24th Jul 2017, 9:45 PM
Boo Da Man
Boo Da Man - avatar
+ 2
you need jre to run java so it is not helpful everytime but it is nothing less than a boon if you need to run same program on different platform. suppose u need to make a program to calculate factorial which will be used by normal user who uses windows or mac then it is nice as you dont have to compile source code again and again to make it ready for different platform. now suppose u need to program a microcontroller and jre is not available for that architecture at that time u may find c or even c++ for that matter useful as the source code is compiled to machine code used by ur architecture and u dont need jre.
24th Jul 2017, 9:24 AM
shobhit
shobhit - avatar