Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class InterClass {
- int x = 4;
- }
- interface MyInterface {
- public static final InterClass inter = new InterClass();
- }
- public class Test implements MyInterface {
- public static void main(String[] args) {
- Test t1 = new Test();
- t1.inter.x = 9;
- Test t2 = new Test();
- t2.inter.x = 7;
- System.out.println(t1.inter.x); //7
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment