Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modifiers

 
Gaia Nathan
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I know that the abstract and final modifiers cannot be used together, but are there any other restrictions on the other modifiers, such as native, transient and so on?
Also, can static and transient modifiers be used together?
Thanks in advance for the help.
Gaia.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best suggestion in learning what modifiers can be used together is to just create a bunch of classes with different combinations and see what the compiler thinks.
In regards to static and transient, if you try it, you should see no problems. Since the two don't really have anything to do with each other, I don't see why there would be a problem (unlike final and abstract, which obviously have a relation).
Jason
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.javaranch.com/ubb/Forum24/HTML/013598.html
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wasn't aware statics weren't serialized, wondered about that after answering the question, makes sense since you're writing the object, and statics aren't associated with an object. Guess that would be why there is no conflict
Jason
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic