Re: Using this() in constructors

2002-01-10 Thread John D. Mitchell
> "Vladimir" == Vladimir G Ivanovic <[EMAIL PROTECTED]> writes: [...] > An alternative is to use factories. Joshua Bloch has a write-up of the > benefits (and the costs) in his excellent adventure, "Effective Java" > (pp. 5-9). W.r.t. this thread, that's just another way to homogenize the sig

Re: Using this() in constructors

2002-01-09 Thread Vladimir G Ivanovic
"JDM" == John D Mitchell <[EMAIL PROTECTED]> writes: JDM> (E) I suggest that you "homogenize" your constructors' declared JDM> exceptions. I.e., make all of them throw the same set of JDM> exceptions. The easy way to get into this habit is to just go one JDM> single step further than you

Re: Using this() in constructors

2002-01-09 Thread Albert Lai
I don't know enough about when and when not this() is allowed. But from my basic understanding of exceptions, and after some coding exercise, I am confused. First, you have: Jim Hazen <[EMAIL PROTECTED]> writes: > ExampleService(String host, int timeout) > {//impl here} This signature require

Using this() in constructors

2002-01-09 Thread John D. Mitchell
> "Jim" == Jim Hazen <[EMAIL PROTECTED]> writes: [...] > In any case, the compiler (Blackdown 1.3.1 FCS) then returned with an > error saying that the call to 'this' must be the first statement in the > constructor (apparently the 'try' is now the first statement and this > isn't allowed). >

Using this() in constructors

2002-01-09 Thread John D. Mitchell
> "Jim" == Jim Hazen <[EMAIL PROTECTED]> writes: [...] > In any case, the compiler (Blackdown 1.3.1 FCS) then returned with an > error saying that the call to 'this' must be the first statement in the > constructor (apparently the 'try' is now the first statement and this > isn't allowed). >

Using this() in constructors

2002-01-09 Thread Jim Hazen
Hi all, I came across something a little odd today. I normally have various signatures to my object constructors, and I usually write one and then use this() from within the others to make minor changes. Like below. ExampleService(String host, int timeout) {//impl here} ExampleService(String