0
How to classify the JavaScript from c++?
when we study both Java and c++,we may have confusion between their scripts
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(){}
}
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.