why wont this method work?

Discussion in 'Java' started by Rookie, Aug 30, 2003.

  1. Rookie

    Rookie Guest

    Why can I not do this?

    initialise();

    from a diffrent class that is it the same directory as

    public static int ticker;

    public static void initialise()
    {
    ticker=0;
    }
    which is in its own class.
     
    Rookie, Aug 30, 2003
    #1
    1. Advertising

  2. Rookie wrote:
    >
    > Why can I not do this?
    >
    > initialise();
    >
    > from a diffrent class that is it the same directory as
    >
    > public static int ticker;
    >
    > public static void initialise()
    > {
    > ticker=0;
    > }
    > which is in its own class.


    You have to tell the compiler which class the method is in. There could be several
    classes with an initialise() method.

    --
    Lee Fesperman, FirstSQL, Inc. (http://www.firstsql.com)
    ==============================================================
    * The Ultimate DBMS is here!
    * FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
     
    Lee Fesperman, Aug 30, 2003
    #2
    1. Advertising

  3. Rookie

    Benny Guest

    Hello,

    If you really want to invoke the static method from other class.
    Then you have to call that method by ClassName.methodname(). The way
    that you mentioned is valid with the same class only. Hope this can
    help you.

    Benny

    "Rookie" <> wrote in message news:<>...
    > Why can I not do this?
    >
    > initialise();
    >
    > from a diffrent class that is it the same directory as
    >
    > public static int ticker;
    >
    > public static void initialise()
    > {
    > ticker=0;
    > }
    > which is in its own class.
     
    Benny, Aug 30, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ß Ø ® G
    Replies:
    8
    Views:
    364
    ß Ø ® G
    Oct 6, 2003
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,218
    Smokey Grindel
    Dec 2, 2006
  3. =?Utf-8?B?cm9kY2hhcg==?=

    why wont this dang thing work...

    =?Utf-8?B?cm9kY2hhcg==?=, Mar 8, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    366
    =?Utf-8?B?cm9kY2hhcg==?=
    Mar 8, 2007
  4. Milsnips
    Replies:
    4
    Views:
    417
    Juan T. Llibre
    Apr 3, 2007
  5. Graham Mattingley

    why wont this work ?

    Graham Mattingley, Jan 22, 2004, in forum: ASP General
    Replies:
    2
    Views:
    563
Loading...

Share This Page