Questions about C++ in general

I'm stumped on these questions that were assigned to me:

What is the primary C++ syntactic structure that implements an Abstract Data Type?
I don't really understand what the book is asking me....

Also,
Give five purely syntactic (not semantic) difference between C++ classes versus Java classes.

What are some differences?

Thanks in advance

What is the primary C++ syntactic structure that implements an Abstract Data Type?


Lets define abstract as any data type, be it ints, char, string, float, or object. Lets say you need to implement some operation that can be done with any data type. How would you go about this, would you write a class/structure for each and every data type, or would you write it once? I'll give you a hint that you can lookup... "generic types".


Give five purely syntactic (not semantic) difference between C++ classes versus Java classes.


Start comparing c++ classes to Java classes and the differences will most likely slap you in the face since we are talking about syntactic differences.

I'll give you one example: Look out how a c++ class inherits from another and do the same for Java.

c++
1
2
3
class MyClass : public BaseClass
{
//..... 


Java
1
2
3
class MyClass extends BaseClass
{
//...... 
Topic archived. No new replies allowed.