Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following table; you are required to discuss thedifferences between

ID: 3611839 • Letter: C

Question

Consider the following table; you are required to discuss thedifferences between C++ and JAVA with respect to givenpoints.                                                                                                                    

    

C++

JAVA

Scope resolution operator

Calling static Data members and functions

Automatic type conversions

Conditional expression evaluation.

Namespace issue.

Destructors

Virtual keyword.

Multiple inheritance

typedefs, defines

preprocessor

Solution required till 11 am , 30-05-09

C++

JAVA

Scope resolution operator

Calling static Data members and functions

Automatic type conversions

Conditional expression evaluation.

Namespace issue.

Destructors

Virtual keyword.

Multiple inheritance

typedefs, defines

preprocessor

Explanation / Answer

In C++, The :: (scope resolution) operator is used to qualifyhidden names so that you can still use them.

Where as There’s no scope resolution operator :: in Java.Java uses the dot for everything

Calling static Data members and functions

In C++, static data members and functions are called using thename of the class and the name of the static member connected bythe scope resolution operator.

Where as In Java, the dot is used for this purpose.

Automatic type conversions

Java does not support automatic type conversions(except where guaranteed safe).

Where as C++ supports.

Conditional expression evaluation.

Conditional expressions in Java must evaluate to boolean ratherthan to integer, as is the case in C++. Statements such asif(x+y)... are not allowed in Java because the conditionalexpression doesn't evaluate to a boolean.

Namespace issue.

The "namespace" issues prevalent in C++ are handled in Java byincluding everything in a class, and collecting classes intopackages.

Destructors:

Java does not support multiple inheritance. To some extent, theinterface feature provides the desirable features of multipleinheritance to a Java program without some of the underlyingproblems.

While Java does not support multiple inheritance, singleinheritance in Java is similar to C++, but the manner in which youimplement inheritance differs significantly, especially withrespect to the use of constructors in the inheritance chain.

Typedefs, defines

Java does not support typedefs, defines, or a preprocessor.Without a preprocessor, there are no provisions for includingheader files.