Subject: All records are posted online

From: I New-Screening Lookup <[email-masked]>
Date: Wed, 25 Jun 2014 07:39:47 -0700

All Records Are Now Posted Online
------------------------------------

(1) New Look Up Request-
Someone may have just accessed your personal record: Do you know what it says about you?

Updated: Atompub-archive - http://www.dubticmystical.com/you/56437f645i3656-lookup.records

------------------------------------

Do you want to know if a person has ever been arrested, married before, a sex-offender, or has a shady past?

Who do you want to know more about:
Put there name : http://www.dubticmystical.com/you/56437f645i3656-lookup.records

------------------------------------

FRF-Database - Lookup - 1007 Main
Street, Eudora, KS, 66025 Exit/messages here- http://www.dubticmystical.com/ind.html
/
/
//

Very nice question. I'll be waiting for a clear answer to this! To me, it seems illogical to use protected static, but my head will explode before I'll be able to explain why.   Lee White Jun 18 at 15:13
  	  	
@TomHawtin-tackline, care to answer, since the original comment was yours?   yshavit Jun 18 at 15:15
  	  	
@yshavit You can't @ mention people in unless they have already commented on this page or are a moderator.   Tim B Jun 18 at 15:16
4	  	
There's nothing wrong with a protected static field, as long as it's final. A mutable static field shared across classes is definitely cause for worry. Multiple classes updating a static field is not likely to be reliable or easy to follow, especially since the presence of any protected field or method implies that the class is meant to be extended by classes in other packages, possibly classes not under the control of the author of the class containing the protected field.   VGR Jun 18 at 15:25
2	  	
@VGR, final doesn't means the field is immutable. You can always modify the object referenced by a final reference variable.   Lone Rider Jun 18 at 16:49 

It's more a stylistic thing than a direct problem. It suggests that you haven't properly thought through what is going on with the class.

Think about what static means:

This variable exists at class level, it does not exist separately for each instance and it does not have an independent existence in classes which extend me.

Think about what protected means:

This variable can be seen by this class, classes in the same package and classes which extend me.

The two meanings are not exactly mutually exclusive but it is pretty close.

The only case I can see where you might use the two together is if you had an abstract class that was designed to be extended and the extending class could then modify the behavior using constants defined in the original. Even then it's a very feeble reason though as you would still almost certainly be better having the constants as public. That just makes everything cleaner and allows the people sub classing more flexibility.

To expand and explain the first point - try this example code