Question: 2 Consider the two classes and the statements below. 1 package exami; 3 public class RunPrivatePublic { public static void main(String[] args) { PrivatePublic pp
2 Consider the two classes and the statements below. 1 package exami; 3 public class RunPrivatePublic { public static void main(String[] args) { PrivatePublic pp = new PrivatePublic(); ) 4 5 6 7 8 9 10 11) 1 package exami; 2 3 class Private Public { 4 5 private int x = 10; 6 double[] y = new double[3]; 7 ge public void prtx() { 9 System.out.println(x); 10 1 11 ) 1. Class RunPrivatePublic can access the variable x directly without need for a method). M. Class Run PrivatePublic can access the reference variable y directly (without need for a method). II. In RunPrivatePublic, the statement pp.prtxo); would successfully print the value of the variable x. Which of the following answer choices below is correct? Statements and I are true Statements I and III are true Statements I and Ill are true Statements I, II, and Ill are true None of the statements are true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
