Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can we pass argument to static block of code????

857542May 15 2011 — edited May 16 2011
hi ,

My question is we can use static initialization block for having functionality like constructors for initializing static variable ,but we cannot pass arguments to static initialization block then how can I create functionality like parametrized constructors.Whats the alternative shall I use a static method to perform this functionality,since all methods in given class are static and
there is no need of creating instance of class.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 13 2011
Added on May 15 2011
6 comments
1,233 views