Parent – child relationship in java

I am trying to understand what would be the best option to emulate the inheritance relationship in java so that the developer would be able to use autocomplete to see the available options under each parent option.

Here’s what I’ve come with, but is it the best way? Also a problem is that it would show things like: Type.A.A.A which is not correct.

package com.vv;
public interface Type {
  static final A A = new A();
  static final B B = new B();
}

class A implements Type {
  public final String A1 = "a1";
  public final String A2 = "a2";

  @Override
  public String toString() {
    return "A";
  }
}

class B implements Type {
  public final String B1 = "b1";
  public final String B2 = "b2";

  @Override
  public String toString() {
    return "B";
  }
}

And here’s how the developer can use it:

package com.vv;

public class Test {

  public static void main(String[] args) {
    process(Type.A, Type.A.A1);
    process(Type.B, Type.B.B2);
  }

  private static void process(Type t, String index ) {
    System.out.println(t +" "+ index);
  }
}