avatar
问个基本问题# Java - 爪哇娇娃
o*n
1
Default constructor (created by system automatically) is public? or default
access? Or depending on the access keyword of the class??
Thanks
avatar
g*g
2
public

default

【在 o*****n 的大作中提到】
: Default constructor (created by system automatically) is public? or default
: access? Or depending on the access keyword of the class??
: Thanks

avatar
o*n
3
那为什么:
Given:
class A
{
A() { }
}
class B extends A { }
Which statement is true?
a). Class B's constructor is public.
b). Class B has no constructors.
c). Class B's constructor includes a call to this().
d). Class B's constructor includes a call to super().
A不对,d对呢?还是A,D都对?

【在 g*****g 的大作中提到】
: public
:
: default

avatar
g*g
4
Sorry, I was wrong, the default constructor has the same access modifier
as the class itself,

【在 g*****g 的大作中提到】
: public
:
: default

avatar
o*n
5
Do you have any reference? I also think so, but just not sure. And I need to
tell more than 20 students regarding this:)

【在 g*****g 的大作中提到】
: Sorry, I was wrong, the default constructor has the same access modifier
: as the class itself,

avatar
g*g
6
http://www.janeg.ca/scjp/lang/constructor.html

to

【在 o*****n 的大作中提到】
: Do you have any reference? I also think so, but just not sure. And I need to
: tell more than 20 students regarding this:)

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。