Answer the question
In order to leave comments, you need to log in
Fields of java inner classes?
public class parcel1 {
class contest{
private int i=1;
int getI(){return i;}
}
class destination{
private String s;
destination(String s){
this.s = s;
}
String getS() {
return s;
}
}
void info(){
contest c = new contest();
System.out.println(c.getI());
System.out.println(c.i);
destination d = new destination("hello");
System.out.println(d.getS());
}
public static void main(String[] args) {
parcel1 p = new parcel1();
p.info();
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question