Why the line Vector<String> result = new Vector<String>(respNum); is not ok????
Code Java:
static Vector findMatch(String str) {
Vector<String> result = new Vector<String>(respNum);
for(int i = 0; i < KnowledgeBase.length; ++i) {
if(KnowledgeBase[i][0].equalsIgnoreCase(str)) {
for(int j = inputNum; j <= respNum; ++j) {
result.add(KnowledgeBase[i][j]);
}
break;
}
Re: Why the line Vector<String> result = new Vector<String>(respNum); is not ok??
Vector<String> result = new Vector<String>(respNum);
I corrected it
Re: Why the line Vector<String> result = new Vector<String>(respNum); is not ok??
You'll have to define "not ok". Do you get an Exception? Does something else happen?
And if you're posting code, make sure you use the code or highlight tags to preserve formatting. The code should be in the form of an SSCCE.
If you do get an Exception in the SSCCE, copy and paste the stack trace here, pointing out any line numbers referenced so we don't have to count them ourselves.