Re: [Eclipse] How to fix indentations.
- From: Pseudo Silk Kimono <misplacedchildhoods@xxxxxxxxxxxxx>
- Date: Mon, 17 Sep 2007 16:09:18 +0000 (UTC)
On Sun, 16 Sep 2007 19:06:19 GMT, Lew expounded upon us in
comp.lang.java.help :
Why do you declare the list static but initialize it in the
constructor? Wouldn't it be better to initialize the list
statically, or else declare it as an instance variable
Lew, perhaps I am wrong but is it not the case that my static
ArrayList is only created once. I was going to put the creation in
the method that picks and displays the random fortune, but I knew
that since I only needed it to be created once, why have the JVM
create it every time.
Apropos of that collection, don't mix generics and raw types.
The variable should be of the interface type, not the concrete
implementation.
I don't understand this. I used Netbeans to do all the initial
work and added the fortune picking piece in Eclipse once I had the
layout working and the button doing something.
It is inadvisable to build the implementation type into the
variable name. "listOf" is redundant and will cause trouble if
you decide later to change the implementation.
This makes sense.
I'll make some changes, fix the indentation and repost with the
intention of this being the solution to one of Roedy's beginnger
projects.
.
- Follow-Ups:
- Re: [Eclipse] How to fix indentations.
- From: Lew
- Re: [Eclipse] How to fix indentations.
- References:
- [Eclipse] How to fix indentations.
- From: Pseudo Silk Kimono
- Re: [Eclipse] How to fix indentations.
- From: RedGrittyBrick
- Re: [Eclipse] How to fix indentations.
- From: Pseudo Silk Kimono
- Re: [Eclipse] How to fix indentations.
- From: Lew
- [Eclipse] How to fix indentations.
- Prev by Date: suitable representation of data in OO programs.
- Next by Date: Re: suitable representation of data in OO programs.
- Previous by thread: Re: [Eclipse] How to fix indentations.
- Next by thread: Re: [Eclipse] How to fix indentations.
- Index(es):