In a java class java.util.Locale, I find that the keyword transient marked a method.
public final class Locale
implements Cloneable, Serializable
{
private static class LocaleNameGetter
implements sun.util.LocaleServiceProviderPool.LocalizedObjectGetter
{
public transient String getObject(LocaleNameProvider localenameprovider, Locale locale, String s, Object aobj[])
{
if(!$assertionsDisabled && aobj.length != 2)
throw new AssertionError();
int i = ((Integer)aobj[0]).intValue();
String s1 = (String)aobj[1];
switch(i)
{
case 0: // '\0'
return localenameprovider.getDisplayLanguage(s1, locale);
case 1: // '\001'
return localenameprovider.getDisplayCountry(s1, locale);
case 2: // '\002'
return localenameprovider.getDisplayVariant(s1, locale);
}
if(!$assertionsDisabled)
throw new AssertionError();
else
return null;
}
Can someone tell me why can this be?
transient
keyword – Cora