2

I have a problem just in the line 5

public static final String[] CREATIVE_SDK_SCOPES = { "email", "profile", "address" };

Inner classes cannot have static declarations

 public final class Keys {
    public static final String CREATIVE_SDK_CLIENT_ID = "xxxxxxxx";
    public static final String CREATIVE_SDK_CLIENT_SECRET = "xxxxxxxxx";
    public static final String CREATIVE_SDK_REDIRECT_URI = "xxxxxxxxxx";
    public static final String[] CREATIVE_SDK_SCOPES = { "email", "profile", "address" };
  }
  private static final String CREATIVE_SDK_CLIENT_ID = Keys.CREATIVE_SDK_CLIENT_ID;
  private static final String CREATIVE_SDK_CLIENT_SECRET = Keys.CREATIVE_SDK_CLIENT_SECRET;
  private static final String CREATIVE_SDK_REDIRECT_URI = Keys.CREATIVE_SDK_REDIRECT_URI;
  private static final String[] CREATIVE_SDK_SCOPES = Keys.CREATIVE_SDK_SCOPES;

inner classes cannot have static declarations

Can you explain what does it mean and how to resolve it?

Yury Fedorov
  • 14,508
  • 6
  • 50
  • 66
drdevax
  • 21
  • 3

1 Answers1

3

because an inner class is associated with an instance, it cannot define any static members itself.

https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

You have to use a static nested class instead.

public static final class Keys {

See Why can't inner classes declare static members?

arekolek
  • 9,128
  • 3
  • 58
  • 79