Given the following application, fill in the missing values in the table starting from the top and going downward.
package competition; public class Robot { static String weight = "A lot"; /* default */ double ageMonths = 5, ageDays = 2; private static boolean success = true; public void main(String[] args) { final String retries = "1"; // P1 /*from ww w . j a v a 2 s .c o m*/ } } Variable Type Number of Variables Accessible at P1 Class : Instance : Local :
B.
In this question that main()
is not a static method, therefore it can access both class and instance variables. Since there are two class variables and two instance variables defined, Option B is the correct answer.