Can transient keywords mark a method?

前端 未结 5 979
小鲜肉
小鲜肉 2021-02-01 17:45

In a java class java.util.Locale, I find that the keyword transient marked a method.

 public final class Locale
    implements Cloneable, Serializable
{
    priv         


        
5条回答
  •  旧时难觅i
    2021-02-01 18:14

    transient can only be applied to member variables and not to methods so there is a problem here.

    Looking at the variable names in your code - things like String s and Object[] aboj - it looks like this source has been generated by decompiling the relevant .class file.

    I think there is a bug in whichever decompiler you're using which is erroneously adding transisent to the method declaration.

提交回复
热议问题