Question: How many printing statements below can be executed? package p 0 ; class C { private int no 1 ; private int no 2 ;

How many printing statements below can be executed?
package p0;
class C{
private int no1;
private int no2;
int no3;
public int no4;
public String getNoI(){
return no1+;
}
protected int getNoII(){
return no3;
}
public double getNoIII(){
return no4;
}
}package p1;
import p0.C;
class MyProg{
public static void main(String[] args){
C c = new C();
System.out.println(c.no1);
System.out.println(c.no2);
System.out.println(c.no3);
System.out.println(c.no4);
System.out.println(c.getNoI());
System.out.println(c.getNoII());
System.out.println(c.getNoIII());
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!