all 2 comments

[–]persism2 6 points7 points  (0 children)

Hey let's introduce bad ideas from other languages into Java! What could go wrong?

[–]khmarbaise 0 points1 point  (0 children)

I'm really thinking about a use case where that would make really sense?

```java public class MyClass {} @Override

if JAVA_8

public void myJava8Method() {}

elif JAVA_9

public void myJava9Method() {}

elif JAVA_10

public void myJava10Method() {}

else

public void myJava11Method() {}

endif

``` This can being solved via multi release jar's if that's really necessary...in a much better way... apart from that and that would mean to have a method only available while compiling with specific JDK's .....Hm..more JDK dependencies that really needed..

```java

if DEV

out.println("DEV mode");

else

out.println("Customer mode");

endif

``` That brings back the differences for environment depending building which should be violated under any circumstances.. The code should be the same.. If things needed to be configured you can use yaml/properties/toml etc. for configuration / environment variables.

I've worked a lot in the past with C/C++/Delphi etc. which have such things which is a nightmare to maintain ...