Java modifiers syntax and format

后端 未结 5 781
梦谈多话
梦谈多话 2020-11-28 14:09

I find myself getting confused as to the order of access and non access modifiers. For example

abstract void go()  
abstract public void go()  
public final          


        
5条回答
  •  星月不相逢
    2020-11-28 14:33

    Just as in the English language, adjectives (modifiers such as public, static, volatile, etc) precede the noun they describe (class, interface, or any type such as int or String). The order of the modifiers doesn't matter to the language, but by reading code you'll quickly find which feel more natural.

提交回复
热议问题