Re: [Class]Ridiculous question
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Fri, 28 Dec 2007 20:04:42 -0500
Stefan Ram wrote:
Daniel Moyne <dmoyne@xxxxxxxxxx> writes:I have a class sosaIndex() that takes one parameter sosaRoot ;
Declarations of constructors or methods have parameters.
Classes do not have parameters (except type parameters).
Type names should start with uppercase letters.
in this class I have a contructor (method sosaIndex) that on
Constructors are not methods.
instanciation calls a method setIndexation based on sosaRoot.
Method calls do not have »bases«.
You might have intended to the /target object/
of a method invocation.
When the first time I instancie to create an object called "aa" I have
this :
sosaIndex aa=sosaIndex(sosaRoot);
To create objects, one usually uses an instance creation
expression, which looks like »new CLASS(...)«
but Java does not say anything wrong if I do again :
(2) sosaIndex aa=sosaIndex(sosaRoot);
I mean instancie a new object with the SAME NAME "aa".
An local identifier can be declared only once within
a block. But the same identifier might be declared
in another block or other scope.
Anything wrong with method (2) and what happens to the first
instanciation "aa" ?
If they have different scopes, they will not disturbe
each other.
To the OP:
It will help you and us if you post a simple, short, complete, compilable example (my version of SSCCE - not the official expansion :) ) illustrating your question and the consequences you wish to discuss.
Your simple, short example should use simple, short indentation based on 2, 3 or 4 spaces per level, depending on your favorite standard of readability. Usenet doesn't like wide lines - keep them to roughly 72 characters (some say even lower) maximum.
Be sure to incorporate Stefan's comments into it - no sense in wasting good advice.
--
Lew
.
- References:
- [Class]Ridiculous question
- From: Daniel Moyne
- [Class]Ridiculous question
- Prev by Date: Re: [Class]Ridiculous question
- Next by Date: Re: question about the toString Method
- Previous by thread: Re: [Class]Ridiculous question
- Next by thread: Re: [Class]Ridiculous question
- Index(es):