Computer Science, asked by snkruthi, 3 months ago

why is java and c++ preferred over html

Answers

Answered by sinturanjan928
0

Answer:

Java supports method overloading whereas C++ supports method overloading as well as operator overloading. ... Java uses Generics whereas C++ uses templates. The JVM helps in an efficient code optimization so the performance of execution of the program is better than as that of C++.

Explanation:

plzz follo me

Answered by riya15955
1

I think I am able to answer the question.

I 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.
Similar questions