mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
encapsulate fields: tests
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
public class A {
|
||||
public int i;
|
||||
}
|
||||
|
||||
class B extends A {
|
||||
public int getI() {
|
||||
return 42;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
A a = new B();
|
||||
a.i = 23;
|
||||
System.out.println(a.i);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user