• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is "Respectively Static"?  RSS feed

 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Language Specification, Section 8.3.2.3, "Restrictions on the use of Fields during Initialization" states the following...

The declaration of a member needs to appear before it is used only if the member is an instance (respectively static) field of a class or interface C and all of the following conditions hold:
  • The usage occurs in an instance (respectively static) variable initializer of C or in an instance (respectively static) initializer of C.
  • The usage is not on the left hand side of an assignment.
  • C is the innermost class or interface enclosing the usage.
  • My question is: What does "respectively static" mean -- especially applied to an instance field?



    Ref: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#287406
    [ September 23, 2004: Message edited by: marc weber ]
     
    Ernest Friedman-Hill
    author and iconoclast
    Sheriff
    Posts: 24217
    38
    Chrome Eclipse IDE Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    They're trying to say that if you replace every occurrence of the word "instance" with "static", the paragraph is still true.
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Oh... Of course. That makes sense (although I think it's poorly phrased).

    Thanks!

     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!