Results 1 to 4 of 4

Thread: Method Help

  1. #1
    Hollywood_99 is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default Method Help

    I am having difficulty figuring out how to write text, put it in a variable and then pass it through a method. I have no problems passing integers or doubles, but when I try to do it with characters I get errors.

    Example:

    int v1 = 2;
    int v2 = 3;
    String myText = "Label One";

    create_Label(v1, v2, myText);

    MyText gives me an error. How do I write a method in a way that I can pass a String value to it?

    Thank you in advance.

    Regards,

    Chad

  2. #2
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    4

    Default

    Where is your method create_Label? You must make sure that create_Label has two integers and a string for it's parameters.
    Sincerely, Joshua Green
    Please REP if I help :)

  3. #3
    Hollywood_99 is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default

    Thank you for your help.

    IT WORKED! I spent hours on this and I couldn't figure it out!!!

  4. #4
    joshdgreen's Avatar
    joshdgreen is offline Senior Member
    Join Date
    Oct 2010
    Location
    Colorado Springs, CO
    Posts
    212
    Rep Power
    4

    Default

    You're very welcome :) Glad you got it all figured out.
    Sincerely, Joshua Green
    Please REP if I help :)

Similar Threads

  1. Thread problem, calling method in run method
    By majk in forum Threads and Synchronization
    Replies: 4
    Last Post: 09-27-2010, 11:40 AM
  2. Turning Recursion Method into Iterative method
    By mattakuevan in forum New To Java
    Replies: 9
    Last Post: 06-15-2010, 06:46 AM
  3. Replies: 2
    Last Post: 03-26-2010, 05:12 PM
  4. ArrayLists compareTo method, equals method
    By random0munky in forum New To Java
    Replies: 2
    Last Post: 10-26-2009, 07:20 PM
  5. cannot call private method from static method
    By jon80 in forum New To Java
    Replies: 3
    Last Post: 05-07-2008, 08:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •