Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Object creation doubt  RSS feed

 
siva mail
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

If iam useing static fields of one class in another class . In this case Object will create for the class where iam accessing the static fields?


thanks
Siva
 
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
Hi,

If I understand your question correctly, the answer is "no", using the static fields of a class won't, in general, cause any instances of that class to be created -- unless the class is specifically designed to create one or more instances when it is loaded.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!