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的值」。它給你編譯錯誤? –