what can I do to use the getTotalScore method on the Program class to get the total of my scores ArrayList, and why must I do that? I wanna understand. Please note I don't wanna make the method static.
import java.util.*;
public class Program {
public int getTotalScore(ArrayList v) {
return total;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
ArrayList scores = new ArrayList<>();
}
}
I can't find an article to help me understand clearly what is up, please help. I got this comment somewhere:
Note that the scores object is not static, so you will have to make an instance of the Program class in order to use the scores ArrayList and the getTotalScore method.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)