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?
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.
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.
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!
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.
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!
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?