3
访问非公共类我有一个类物流中包序列其他包装
package sequence;
class LogisticSeq {
int limit;
double lamda;
ArrayList <Double> lseq = new ArrayList <Double>();
LogisticSeq(int a, double b, double c) {
limit = a;
lseq.add(b);
lamda = c; }
void sequence() throws IOException{
File file = new File("Sequence.txt");
if (!file.exists()) {
file.createNewFile();
}}
public class Logistic {
public static void main (String[] args) throws IOException {
LogisticSeq L = new LogisticSeq(50,0.4999,3.9999);
L.logisticsequence();
}
如何从类访问类LogisticSeq其他包装
也许公开。 –
你不能,这正是“包私人”的含义。将它“公开”或放在同一个包中。 –
@Hovercraft完整的鳗鱼我试图改变它为公众,但我得到了日食中的错误,并说在自己的文件中定义它。 – Kailash