2 Questions about Constructor# Java - 爪哇娇娃
t*l
1 楼
1. 我看过的SOURCE CODE中
CONSTRUCTOR有的被DECLARE成PUBLIC,有的则没有任何ACCESS CONTROL
我想知道CONSTRUCTOR只可以被DECLARE成这2种形式么?如果是的话,他们的含义是
什么样子呢?我用GOOGLE SEARCH了一下,好象没有具体讲这个的。
2. 这个和MEMBER CLASS也有关系. 有这样一段CODE:
public class LinearLUT {
/**
* The member class Key is used for the indexing keys of the LUT. It
* is a String with basic comparative methods added.
*/
protected class Key {
public Key(String s) {
kString = s;
}
private String kString;
}
/**
* The member class Entry encapsulates an entry of the LUT and contai
CONSTRUCTOR有的被DECLARE成PUBLIC,有的则没有任何ACCESS CONTROL
我想知道CONSTRUCTOR只可以被DECLARE成这2种形式么?如果是的话,他们的含义是
什么样子呢?我用GOOGLE SEARCH了一下,好象没有具体讲这个的。
2. 这个和MEMBER CLASS也有关系. 有这样一段CODE:
public class LinearLUT {
/**
* The member class Key is used for the indexing keys of the LUT. It
* is a String with basic comparative methods added.
*/
protected class Key {
public Key(String s) {
kString = s;
}
private String kString;
}
/**
* The member class Entry encapsulates an entry of the LUT and contai