Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Parent{
- int x = 5;
- }
- class Child extends Parent{
- int x = 10;
- public void Info(int x){
- System.out.println("Nilai X sebagai parameter = " + x);
- System.out.println("Data member X di class Child = " + this.x);
- System.out.println("Data member X di class Parent = " + super.x);
- }
- }
- public class Tes_Super {
- public static void main(String args[]){
- Child tes = new Child();
- tes.Info(20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment