CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
What are the main differences between Java and C++?
Category Java Interview Questions
Rating (3.3) By 6 users
Added on 10/13/2004
Views 1475
Rate it!
Answers:

Everything is an object in Java (Single root hierarchy as everything gets derived from java.lang.Object). Java does not have all the complicated aspects of C++ ( For ex:
Pointers, templates, unions, operator overloading, structures etc..) The Java language promoters initially said "No pointers!", but when many programmers questioned how
you can work without pointers, the promoters began saying "Restricted pointers." You can make up your mind whether it?s really a pointer or not. In any event, there?s no
pointer arithmetic. There are no destructors in Java (automatic garbage collection). Java does not support conditional compile (#ifdef/#ifndef type). Thread support is built
into java but not in C++. Java does not support default arguments. There?s no scope resolution operator :: in Java. Java uses the dot for everything, but can get away with it
since you can define elements only within a class. Even the method definitions must always occur within a class, so there is no need for scope resolution there either.
There?s no "goto " statement in Java. Java doesn?t provide multiple inheritance (MI), at least not in the same sense that C++ does. Exception handling in Java is different
because there are no destructors. Java has method overloading, but no operator overloading. The String class does use the + and += operators to concatenate strings and String expressions use automatic type conversion, but that?s a special built-in case. Java is interpreted for the most part and hence platform independent.



If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    What are interfaces?
    View Answer
    How can you achieve Multiple Inheritance in Java?
    View Answer
    What is the difference between StringBuffer and String class?
    View Answer
    Describe, in general, how java's garbage collector works?
    View Answer
    What's the difference between == and equals method?
    View Answer
    What are abstract classes, abstract methods?
    View Answer
    How can you force all derived classes to implement a method present in the base class?
    View Answer
    What is the difference between an Applet and an Application?
    View Answer
    Java says "write once, run anywhere". What are some ways this isn't quite true?
    View Answer
    Describe java's security model.
    View Answer

    Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

    Notify me when better answer is posted!
    Email:

    View ALL Java Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions
    Page URL: http://www.coolinterview.com/interview/459/default.asp?cachecommand=bypass


    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

    1.88
    Cache = 0 Seconds