Search:

Type: Posts; User: Norm

Search: Search took 0.19 seconds.

  1. Re: Link objects and calling a variable object's method

    If arrObjects is an array of instances of a class that defines the doSomething() method, that should work.
  2. Re: Link objects and calling a variable object's method

    Look at the statement the compiler error is on.


    What is it that you did there?

    If you want to use a String to get a reference to an existing instance of a class, use a Map. Something like:...
  3. Re: Link objects and calling a variable object's method

    The compiler can not find the method: doSomething() in the String class.
    The arrObjectNames array holds String objects.

    That method is in the TestThing class. You need to have a reference to an...
  4. Re: Link objects and calling a variable object's method

    The compiler recognizes a method call by the ()s at the end of the symbol.
    doSomething is missing the ()s
  5. Re: Link objects and calling a variable object's method

    No problem. I'll wait until you can try the code you are asking about with a compiler to see what happens.
    Copy any error messages and paste them here with the code.
    Be sure to wrap the code in...
  6. Re: Link objects and calling a variable object's method

    referenceToClass.methodName(argsToMethod);
  7. Re: Link objects and calling a variable object's method

    1) Have an arraylist in the Author's class that contains the books he wrote
    and/or have a field in the Book class that has the address of the Author that wrote it.

    2) Not sure what the problem...
Results 1 to 7 of 7