Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Base {
- int id = 1000;
- Base() {
- Base();
- }
- void Base() {
- System.out.println(++id);
- }
- }
- public class Derived extends Base {
- int id = 2000;
- Derived() {}
- void Base() {
- System.out.println(--id);
- }
- }
- public class Test {
- public static void main(String[] args) {
- Base base = new Derived();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement