0
我在访问我的代码中的某些字段时遇到问题,我想知道处理此问题的有效方法。访问字段,Java
public class Indexer {
static private int startKeyIndex = 0;
static private String patternKey = new String();
.
.
private static void extractIndexes(String content) throws IOException {
patternKey = "this is a regex for finding keywords, hi!"
startKeyIndex = extractIndexFromPattern(contentKey, patternKey);
} .
.
.
private static void extractKeywords(String pattern, String content) throws IOException{
//The problem is in this method
CharSequence contentSeq = content.subSequence(0,3000);
String area = extractStringFromPattern(content, patternKey);
}
如何你正在访问? –
什么是某些领域? – Sam
@你是什么意思“无法访问startKeyIndex的值”。它给你编译错误? –