Q.java

an anonymous user · September 16, 2021 · Java
import java.util.*;
import java.lang.*;
import java.io.*;

class A{
    protected int i=0;
    protected A(int i){this.i=i;}
    public int getl(){return i;}
}

public class Q extends A{
    Q(int j){
        super(j);
        i=3;
    }
    // The main method must be in a class named "Main".

    public static void main(String[] args) {
        A q=new Q(2);
        System.out.println(q.getl());
    }
}










Comments

Please sign up or log in to contribute to the discussion.