How Java Differs From C And C++

  • 1.8K
  •  
  •  
  •  
  •  
  • 1
  •  
  •  
    1.8K
    Shares
The following two tabs change content below.

Unallocated Author

Please note that the article you are reading has an unallocated author as the original author is no longer employed at latesthackingnews.com, this has been put in place to adhere with general data protection regulations (GDPR). If you have any further queries, please contact: [email protected]

Latest posts by Unallocated Author (see all)

Unallocated Author

Please note that the article you are reading has an unallocated author as the original author is no longer employed at latesthackingnews.com, this has been put in place to adhere with general data protection regulations (GDPR). If you have any further queries, please contact: [email protected]

17 thoughts on “How Java Differs From C And C++

  • August 17, 2015 at 8:32 pm
    Permalink

    to AAKASH

    Java and PHP are kinda hard to compare mainly because PHP is used for websites and Java can be used for just about anything, but from what i understand a lot of big companies prefer Java to PHP for their backend stuff. To make a small website or a blog or something I’d use PHP, i guess that’s why wordpress and pivot-x are both written in PHP

  • May 25, 2015 at 8:57 am
    Permalink

    The reason why Java is slower than C/C++ is because it runs on java virtual machine hence portability of apps whilst the latter run on machine directly hence not portable. However, running on some virtual machine means more processing time because the machine has now to communicate with the hardware unlike a c/c++ program which deals with h/w directly.. 🙂

    • August 17, 2015 at 5:40 pm
      Permalink

      That’s true to some extend, but because of java “Just-In-Time” compilation feature it’s even faster than c/c++.

      • August 18, 2015 at 5:07 am
        Permalink

        Please stop deceiving yourself that Java can be faster than C++ under any circumstances. JVM is not the real performance killer (although it used to be when Java was x20 slower than C++ back in the day). There are so many tricks about inlining and memory that an expertly tuned C++ program can only be rivaled by (much uglier) C code, the impossibility of performing those tricks in Java is the real performance (memory AND CPU) killer. I know a lot of Java and I know its weaknesses very well, but if you think JIT makes up for the difference between Java and C++ then you know nothing about C++.

  • February 23, 2015 at 12:07 am
    Permalink

    This article should have more typos

  • February 21, 2015 at 8:18 am
    Permalink

    Java is only suitable for application development; it’s far too abstract for low-level programming. While that abstraction makes it easier to write cross-platform applications it comes at a cost in both performance and efficiency. Java compiles to byte code not native machine code, and that byte code needs to be interpreted by a virtual machine every time it is executed. Java’s garbage collection also means you waste far more memory than you would with well-designed C++ resource handles that automatically release resources as soon as the handle falls from scope. Java encourages sloppy programming whereas C++ encourages good programming style.

    • August 18, 2015 at 5:13 am
      Permalink

      Exactly! People are deceived that there’s no memory management in Java, but in a sufficiently complicated project there’s plenty. Say you have a component in some GUI, and you decide to get rid of it. How do you make sure that it does indeed get garbage collected? How do you know it’s not hanging around due to some listener holding a reference to it? The language provides you with no tools whatsoever to formalize ownership semantics. Beyond “if I’m pointing to it, it’s still alive” there’s no support and the resulting solution is no prettier than plain old C. Resource management can not be handled automatically by the language! It’s a non-trivial problem beyond the most trivial programs, and you need a language that helps you with it, not one that pretends to solve it while hiding it under the rug.

  • February 20, 2015 at 6:24 pm
    Permalink

    Over a decade programming with all the three but this article sheds more light to what am already aware of. Need some more 🙂

    Voila!

  • February 20, 2015 at 4:35 pm
    Permalink

    I think most important thing is that C++ differs in performance from java. C++ or C is way faster then java and more creative too.

  • December 6, 2014 at 2:18 am
    Permalink

    Thanks alot, so generous of you quite informative as well.
    Need more guys like u.

  • November 15, 2014 at 5:46 pm
    Permalink

    Thank for info…plz.. Sent info to crate user logine data base in websites

  • November 7, 2014 at 1:45 pm
    Permalink

    informative……………thanx

    NEED MORE TOPICS………………

  • November 7, 2014 at 6:10 am
    Permalink

    Thanks it helped me a lot. Finally got to know the real difference between JAVA and C. I will appreciate if you compare Java and PHP as well

  • November 6, 2014 at 12:51 pm
    Permalink

    Thanks for the interesting differences!

  • November 6, 2014 at 8:29 am
    Permalink

    Great updates given by ur portal, thats helps us lot. Thanks

Comments are closed.

Do NOT follow this link or you will be banned from the site!