Suggest you to learn C++ for competitive programming as it is faster than languages like python or java ..C++ also provides vast library (STL) and resources needed for competitive programming..
Learn Java for development purpose. Here are some points that tells us why java is preferred over C++ for development purpose
- Platform Independent
- Unlike C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code (.class files). This .class files can be executed by any operating system any platform which have JVM application running in it.
- So, programs developed and compiled in java in one machine can be executed in any other machine provided JVM for that machine is installed.
- Secure Application Development
- To understand how Java is Robust, following two points are just for better understanding.
- 1. When you compile C or C++ programs, it gives executable file (.exe file) as an output. We don't need any applications to run that .exe file in any OS, we can directly run that .exe file
- 2. C, C++ programs supports pointers
- Using C, C++ we can write programs where we can convert a laptop or desktop into a bomb. Computers have some capacitors in it which stores charge. It is possible to write such programs using C++. The moment you double click on .exe file, some of the capacitors in the circuit get bursts. It is possible to write such programs because C,C++ helps us to control hardware using pointers and it's output is .exe file and you don't require any application to run that .exe file.
- And that is the only reason, why most of the viruses in the world are developed using C or C++. Some people write this type of codes, make virus programs. Somehow that virus comes and sits in your computer and it will get executed on its own and it may interact with your hardware, disk drive or information present in that.
- In Java, compiled output is .class file. We can run .class file only if JRE is present. JRE is one and only application which can run .class files. So, what ever programs you write is directly under the control of JRE. And Java doesn't have pointers. So, even if you write such programs, and if JRE comes to know that it may miss behave, JRE prevents it because .class files are directly under control of JRE.
- So, because of these Java is secure and C, C++ are not secure languages
- Follow This Link for Info about Java : ( Video )
- https://www.youtube.com/channel/UCt4gPu9kWVFQucNixJwU4kg/videos
No comments:
Post a Comment