reline
06/14/2024, 6:49 PMreline
06/14/2024, 6:50 PM// ThirdPartyInterface.java
public interface ThirdPartyInterface {
public static final String HELLO = "hello";
}
// MyConstants.java
public class MyConstants {
public interface HelloWorld extends ThirdPartyInterface {
public static final String WORLD = "world";
}
public static class HelloWorldExclamation implements HelloWorld {
public static final String EXCLAMATION = "!";
}
}
println(ThirdPartyInterface.HELLO)
println(MyConstants.HelloWorld.HELLO)
println(MyConstants.HelloWorld.WORLD)
println(MyConstants.HelloWorldExclamation.HELLO)
println(MyConstants.HelloWorldExclamation.WORLD)
println(MyConstants.HelloWorldExclamation.EXCLAMATION)
reline
06/14/2024, 6:50 PMMyConstants.java
to be converted to kotlin.reline
06/14/2024, 6:51 PMJoffrey
06/14/2024, 6:52 PMHELLO
be available in MyConstants.HelloWorld
? Did you forget inheritance relationships somewhere in the sample code?reline
06/14/2024, 6:53 PMJoffrey
06/14/2024, 6:54 PMreline
06/14/2024, 7:01 PMobject HelloWorld {
// would like to eliminate having to add this manually
const val HELLO = BaseContract.HELLO
const val WORLD = "world"
}
// preferably would like to reference `HelloWorld` here instead
put(BaseContract.HELLO)
put(HelloWorld.WORLD)
reline
06/14/2024, 7:24 PMSystem.out.println(HelloWorld.HELLO);
// changes to
println(ThirdPartyInterface.HELLO)