We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
由此我们可以得出结论:构造函数如果返回基本类型,则会忽略,还是返回原来的this(新对象).如果返回的是引用类型,则会对该返回值进行处理,返回该返回值。
知道new操作符做了什么,我们要实现就不难了,直接上代码!
The text was updated successfully, but these errors were encountered:
假如res刚好等于null,理应也返回o的。
res
null
o
Sorry, something went wrong.
No branches or pull requests
new操作符做了什么?
如果我们在构造函数中进行显式返回,会发生什么?
new操作符的模拟实现
知道new操作符做了什么,我们要实现就不难了,直接上代码!
The text was updated successfully, but these errors were encountered: