0

How to classify the JavaScript from c++?

when we study both Java and c++,we may have confusion between their scripts

16th Mar 2018, 3:41 PM
VIGNESWARAN S
VIGNESWARAN S - avatar
2 Answers
+ 1
Java and JavaScript are two different things. But I’m assuming you’re talking java. Java and c++ have different syntax. One of their biggest differences is that c++ needs both a header and source file, for example: Ex.h class ex { public: ex(); ~ex(); } Ex.cpp ex::ex(){} ex::~ex(){} In java, there are no destructors. A similar version would be: class ex { ex(){} }
16th Mar 2018, 3:48 PM
Ariela
Ariela - avatar
0
Also java is a managed memory environment, meaning you don’t have to worry about memory allocation and deallocation. In c++, you have to make sure to free pointers and any other memory you use.
16th Mar 2018, 3:49 PM
Ariela
Ariela - avatar