r/learnjava • • Oct 28 '18

→ /r/javahelp ← Writing a function in java

Hi, I am new to java. Can you please tell me which is the basic semantic to create a function in java? I am at the beginning, I want to know how does it start a function in java

Let's assume I have the object ''player'' and I want this object moves straight up everytime the X button on a joystick is pressed.

Well, basically... how can this be done in java? This is a function, right? Ok, how can it be performed (the basiacally initial code)?

0 Upvotes

2 comments sorted by

View all comments

1

u/TheNarfanator Oct 28 '18

I really want to help, but I don't know where to start.

I think what you're looking for is a "method", but to get to where you want to go, you gotta know other stuff first.

Here's a link.

https://docs.oracle.com/javase/tutorial/java/javaOO/index.html

You can PM/DM me for any other questions, but I'm not that good of a programmer.