The longest keyword chain?

When I introduced some constants in Java, I noticed that I used the 4 key words in a row that Eclipse has allocated for me public static final int. Then I paused from my usual coding and asked myself (and Google without any relevant results) which longest keyword chain I could use and still have valid code. After a while, the best I could come up with was defining this method:

public synchronized static final strictfp int a() { ...

which is 6 keywords in java. Is it possible to go 7 or even higher? What about other languages?

+3
source share
2 answers

Inside the body of the method, you can combine as domany as you want:

do do do do do do do do 
    break;
while (false); while (false); while (false); while (false); while (false); while (false); while (false); while (false);
+5

, :

@deprecated
public synchronized static final strictfp int a() throws java.lang.ArrayOutOfBoundException, IllegalCastException  { ...
+1

Source: https://habr.com/ru/post/1722222/


All Articles