[英]Accessing the public class variable from another class in same directory
I've come across a java code in which the method aw_best_tour_index()
of public class Utilities access the variable of the class InOut
which is public
.我遇到了一个 java 代码,其中公共 class 实用程序的方法
aw_best_tour_index()
访问 class InOut
的变量是public
的。 The variables of the class InOut
are best_in_try
and max_index
. class
InOut
的变量是best_in_try
和max_index
。 They've been called in the method like this:他们在这样的方法中被调用:
final int[] values = InOut.best_in_try;
and和
final int l = InOut.maxindex;
. .
But when I compile this using javac in command prompt it shows the error "Cannot find symbol".但是当我在命令提示符下使用 javac 编译它时,它会显示错误“找不到符号”。 What should be reason for this?
这应该是什么原因?
There could be multiple problems:可能有多个问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.