由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - one more interview question
相关主题
问个无厘头问题容器中放置智能指针一问
c++ initialize struct关于内存泄漏
请教个Bloomberg 的 C++ 题目Help! Virtual Destructor
[C++] when destructors get calledA try-catch problem in C++
【C++】请问这样有没有memory leak?多谢some C++ interview questions
问一个private destructor的问题问两个问题,C++
Interview question: is the following code OK?请问2个类的问题
菜鸟请教smart pointer[合集] C++ interview question help
相关话题的讨论汇总
话题: java话题: struct话题: c++话题: question话题: multiple
进入Programming版参与讨论
1 (共1页)
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

1 (共1页)
进入Programming版参与讨论
相关主题
[合集] C++ interview question help【C++】请问这样有没有memory leak?多谢
急问:compile and build dependency问一个private destructor的问题
请教一下,exception时,destructor一定会被调用么?Interview question: is the following code OK?
请问C++ exception后如何清理function stack上的内存资源?菜鸟请教smart pointer
问个无厘头问题容器中放置智能指针一问
c++ initialize struct关于内存泄漏
请教个Bloomberg 的 C++ 题目Help! Virtual Destructor
[C++] when destructors get calledA try-catch problem in C++
相关话题的讨论汇总
话题: java话题: struct话题: c++话题: question话题: multiple