m*******o 发帖数: 264 | 1 Tell something about the difference between class of Java and
struct in C++? | m*******o 发帖数: 264 | 2 Let me finish this answer:
The only different between class and struct in c++ is the default access:
public in struct and private in class.
But this question ask the different between class of java and struct in c++,
so first of all, java doesn't have struct, and in java, there is no
destructor due to the garbage collection, also no operator overloading, no multiple
inheritance in java. All parameters are passed by reference in java | S*********t 发帖数: 78 | 3 这个题主要是考OO
java class has behavior, while struct does not.
+,
multiple
【在 m*******o 的大作中提到】 : Let me finish this answer: : The only different between class and struct in c++ is the default access: : public in struct and private in class. : But this question ask the different between class of java and struct in c++, : so first of all, java doesn't have struct, and in java, there is no : destructor due to the garbage collection, also no operator overloading, no multiple : inheritance in java. All parameters are passed by reference in java
| c*****t 发帖数: 1879 | 4
+,
multiple
^^^^^^^^^
correction: by value.
i.e. pointers are passed by value, and so do primitive types.
Also, technically, implementing multiple interfaces is multiple inheritance.
Bottomline, be extra careful when you answer this type of questions. Even
though you know what you are talking about, but getting 100% right isn't
easy.
【在 m*******o 的大作中提到】 : Let me finish this answer: : The only different between class and struct in c++ is the default access: : public in struct and private in class. : But this question ask the different between class of java and struct in c++, : so first of all, java doesn't have struct, and in java, there is no : destructor due to the garbage collection, also no operator overloading, no multiple : inheritance in java. All parameters are passed by reference in java
| p***o 发帖数: 1252 | 5 If that's the intent of the interviewer,
I'll say he knows nothing about c++ ...
【在 S*********t 的大作中提到】 : 这个题主要是考OO : java class has behavior, while struct does not. : : +, : multiple
|
|