Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A7 {
- int ax = 10;
- int ay = 20;
- }
- class B7 extends A7 {
- int bx = 30;
- int by = 40;
- }
- public class TestAB {
- public static void main(String[] args) {
- B7 b = new B7();
- A7 a = new B7();
- System.out.println("B7: " + b.bx + ": " + b.by);
- System.out.println("A7: " + a.ax + ": " + a.ay);
- b.bx = 5;
- b.by = 6;
- System.out.println("B7: " + b.bx + ": " + b.by);
- System.out.println("A7: " + a.ax + ": " + a.ay);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement