+ 1
Which is better java or c++?
8 odpowiedzi
+ 4
C++ doesn't use a garbage collector, which has advantages and disadvantages.
On one hand, you need to track memory allocations yourself and remember freeing unused data. On the other hand, performance is predictable, and your application won't freeze for several seconds because the Java VM decided thay now is the right time to free some memory, just as your java-controlled drone is descending quickly towards the ground.
Another major difference is that Java compiles the code to a virtual machine, while C++ compiled to a true machine code. Other than the portability advantage of Java that was already mentioned above, the use of a VM carries with it some performance penalty.
However, as the Java technology gets better with JIT (just in time) technology that recompiles your Java byte code to machine language at runtime, java runtime speed approaches that of C++ and in some circumstances may even surpass it, esp. when runtime data can cause code optimizations by the VM, not possible in C++ due to the use of a static compiler.
+ 2
There is no better one... Both have adventages and disadventages. For beginners it makes no difference, so basically if you learn C++ you can code in Java without bigger problems.
+ 1
c++ is better where you want more performance,like all big companies uses c++ code for their servers when they require heavy computation and java is best when it comes to platform independence is required
+ 1
it really depends on the task that is asked from you. if you have the time, take that opportunity and learn both, it will make you that much stronger.
0
both need
0
It May depend on your idea of "better". Also, what you plan to do with them. One wouldn't want to use a screw driver for a nail.
- 1
well, i havent started C++ yet, nor do I think I will be learning it anytime soon. I'm saying Javascript, because I'm learning both that, and php at the moment, since I'm new to the codeing community.
- 2
I dont know any c++ but i think java script