I want my program to input a private variable from another class.
I want to use the mutator and accessor.
It keeps erroring NullPointerException. What's the problem in my code?
public abstract class Inputs {
private String val;
private String typ;
public abstract void setVal(String val);
public abstract void setTyp(String typ);
public abstract String getVal();
public abstract String getTyp();
}
public DeckOfCards extends Inputs{
String val;
String typ;
static DeckOfCards kerds = new DeckOfCards();
    public void setVal(String val){
        this.val = val;
    }
    public void setTyp(String typ){
        this.typ = typ;
    }
    public String getVal(){
        return this.val;
    }
    public String getTyp(){
        return this.typ;
    }
    public static void main(String args[]){
       System.out.print("Value: ");
       kerds.setVal(kerds.val);
       if(kerds.val.equals("A"){
          System.out.print("Type: ");
          kerds.setTyp(kerds.typ);
       }
    }
}
 
     
     
    