开发者

Longest keyword chain? [closed]

开发者 https://www.devze.com 2022-12-11 07:13 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

Improve this question

As I was typing some constants in Java I noticed I had used 4 keywords in a row, which Eclipse highlighted for me: public static final int. I then took a break from my regular coding and asked myself (and google with no relevant results) what the longest chain of keywords I can use and still have valid code. After a while, the best I could come up with was this method definition:

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

which is 6 keywords in Java. Is it possible to 开发者_如何学Gogo 7, or even higher? What about other languages?


Inside a method body you can chain as many dos together 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);


Same as your:

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

精彩评论

暂无评论...
验证码 换一张
取 消