1. Howdy! Welcome to our community of more than 125.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
    Dismiss Notice
  2. Add your web host to our brand new web hosting directory (beta).
    Dismiss Notice

What the different between C++ and java

Discussion in 'Programming Help' started by kellythomus, Aug 23, 2011.

  1. kellythomus

    kellythomus New Member

    I want learn oops language but i am confuse witch oops language are best c++ or java, so give suggestion, who is the best and whta the different between c++ and java.
     
  2. TehGuy

    TehGuy Active Member

    For learning, I would say it depends. If you have a good book or guide, or instructor, and you want to get in-depth, I'd go for C++. It'll allow you to get down the basics of OOP and allow you to get a better understanding of data structures by implementing them yourself.

    Java is maybe a little simpler to figure out from a beginner's point of view, so I'm learning towards it. You don't have to worry about memory management, pointers, or implementing your own data structures to do some really cool things. Java has a garbage collector to do memory management for you, and most data structures are already implemented for you, so you can get right down to learning about syntax and data types and what all that "public static void main" business means, and how classes/objects are used, etc. The technical stuff is still very useful to know!

    Both languages are very "C like" (C++ obviously being more so haha), so if you learn one, the other will come very quickly to you.

    Outside of those two, I've heard Python and C# are good choices for beginner languages, too, though I have no experience with them.
     
  3. Dynash

    Dynash It gets better. NLC

    Are you just wanting to learn OOP? You don't need to use C++ or Java for either, you can use PHP. But I'd vote C++.
     
  4. CLERKHOST

    CLERKHOST New Member

    C++ is for beginners and it is much closer to processor and java is not for beginners So i recommend you if you are new in programming then frist use C++.
     
  5. JAVA- Java does not support pointers, templates, unions, operator overloading, structures etc.Java support automatic garbage collection. It does not support destructs as C++ does.Java does not support conditional compilation and inclusion.Exception handling in Java is different because there are no destructors.

    C++ - C++ supports structures, unions, templates, operator overloading, pointers and pointer arithmetic.C++ support destructors, which is automatically invoked when the object is destroyed.Conditional inclusion is one of the main features of C++.While in C++, you may not include the try/catch even if the function throws an exception.

    WEB HOSTING
     
  6. VPSNest

    VPSNest New Member

    For java you won't need to worry about which platform you are developing, the JVM takes care for you.

    Java is strictly OOP. One thing not mentioned yet, is that Java does not support multiple inheritance, this can be seen as a pro or con, depends on your point of view, probably a big down is not supporting operator overloading because it will make simpler things like "object_A + object_B" into "object_A.sum(object_B)" (ugly).

    Overall, Java provides you a more controlled environment at the cost of less freedom like C++ could give you
     

Share This Page