Question: 5 6 8 9 Consider the two casses and the statements below. package exami; 1 package exani; 2 public class RunPrivatePublic { 3 class PrivatePublic
5 6 8 9 Consider the two casses and the statements below. package exami; 1 package exani; 2 public class RunPrivatePublic { 3 class PrivatePublic { 4 public static void main(String[] args) { 5 private int x = 18; 6 PrivatePublic pp = new PrivatePublic(); double[] y = new double[3]; 7 8 public void prtx() { } 9 System.out.println(x); 10 10 } 11) 11 ) 1. Class Run PrivatePublic can access the variable x directly (without need for a method). II. Class Run PrivatePublic can access the reference variable y directly (without need for a method). Ill. 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 1 and il are true Statements I and Ill are true Statements II and Ill are true Statements ll, and all are true O 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
