so I came across a task that stumped me today..the one on calling methods..I didn't really see anything bout calling methods in the reading...
I HATE using the "hint" button because I want to do it one my own..it didn't make sense but looked up calling methods on youtube..and think I understand now?
a method is declaring/setting something in stone so you can refer back to it using a shortcut later on?
like if you declare that multiply(int a, int b) means (a * b) In a method...anytime I use the word multiply followed by () I would get the answer??
like
multiply(5, 10);
public static void multiply(int a, int b){
System.out.println(a * b);
}
I feel bad if I can't do the tasks soon my own..is it okay to look things up???am I missing something?
Discouragement
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Anthony Chalk
14 January 2020, 09:01
Don't get discouraged. Everyone looks stuff up the whole time.
A brief look at some programming forums will tell you that even experienced developers spend a significant amount of time googling stuff.
As for this particular issue, a method is just a bunch (to use the technical word :p) of commands.
The convenience of this is that instead of writing all those commands each time, you simply call the method.
Right now the examples you're seeing are pretty small, just getting you acquainted with how they work, later you'll see how much easier this makes life for you.
Best of luck, and don't give up, we all feel like it's just not going in sometimes :)
0