A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Customer Requirements for Developers
this week in the
Can init block be declared between a couple of methods?
Joined: Mar 17, 2011
Jul 05, 2011 10:30:02
Can init block be declared between a couple of methods?if yes,then how.Please Give code...
Joined: Oct 14, 2005
Jul 05, 2011 10:32:56
You're asking for a code example for that question? Really? When you could have spent 30 seconds producing an example to ask about? Come on. Show us an example. And tell us what happened when you compiled it and what your question is about that.
Joined: Mar 10, 2008
Jul 06, 2011 01:27:42
Initialization blocks can be put any place in the
code file. The compiler will sort it out.
However, the Java Coding Convention has an opinion on where to put them. Static initialization blocks first, then instance initialization blocks. After that comes the constructors and then the rest.
for a good article about Initialisation blocks.
It is sorta covered in the
JavaRanch Style Guide
subject: Can init block be declared between a couple of methods?
what is the difference between 2 init() methods.
Q based on Dan's exam
Pl Validate the points
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015