+ 3
how to use inner class and where please give an example
1 ответ
+ 1
public class SuperC{
int x;
int y;
protected class InnerClass{
public void increment(int num) {
return ++num;
}
}
here you have an inner class encapsulated inside a class, only this class and his inheritances can access this inner class. that can help you if you want "hide" methods from another classes