我在访问代码中的某些字段时遇到问题,我想知道一种有效的方法来处理这个问题。
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);
}