Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Fuctions

  1. #1
    Junior Member Europa's Avatar
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    9
    My Mood
    Grumpy
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Talking Fuctions

    I'm doing a project for my Computer Science Class and I need some help understanding basic functions and making custom fuctions. Could someone please explain them to me?
    I don't know what your problem is, but I bet it's hard to pronounce.

  2. Default Related threads:


  3. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #3
    Junior Member Europa's Avatar
    Join Date
    Dec 2011
    Location
    Texas
    Posts
    9
    My Mood
    Grumpy
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Re: Fuctions

    Ah, I still don't quite understand despite reading that and my program is beginning to wear on me.
    It's asking for an identifier, what's that?
    I don't know what your problem is, but I bet it's hard to pronounce.

  5. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Fuctions

    Compare what you have to the syntax presented in the tutorial. If you still can't figure it out, you'll have to provide an SSCCE (not your whole program, but enough for us to copy and paste to see the problem) that demonstrates exactly what you're talking about along with the full text of the error message and which line it's talking about.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  6. #5
    Member clydefrog's Avatar
    Join Date
    Feb 2012
    Posts
    67
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: Fuctions

    This probably doesnt do it justice, but a simple way to envision it is as an input/output box. You're passing in some sort of value, performing actions on it, and then returning an output (unless you dont want to return something).

    input --> [Function] --> output

    for example, you have a function that multiplies everything by itself (squares the number). you pass in int, perform the function and then return the answer (if you choose to).

    5 --> [5 * 5] --> 25
    input --> [input * input] --> output

    Just one way to look at it lol. Is there something in specific you dont understand or would like help with clarifying? Perhaps you'd like us to look at your code?

Tags for this Thread