Declarations and Access Control Logic
© examsiri.com
Question : 18 of 29
Marks:
+1,
-0
Given:
Which change can you make to Target without affecting Client?
1. public class Target {
2.   private int i = 0;
3.   public int addOne(){
4.    return ++i;
5.   }
6. }
And:
1. public class Client {
2.   public static void main(String[] args){
3.    System.out.println(new Target().addOne());
4.   }
5. }Which change can you make to Target without affecting Client?
Go to Question: