Im having difficulties understanding how to split my program up into smaller functions instead of a cluster of code in the main function. Yes, I have looked for a guide on my own. The ones that I found either didn't help or further confused me. Thanks :)
Edit: I come from a very limited C++ and JavaScript background.
In C++ I could simply do this:
int main () {
int x,y;
cin >> x >> y;
cout << addNum(x,y) << endl;
}
int addNum(num1,num2) {
return num1+num2;
}
Im so lost in java. :S
I think you should read into "Object Oriented Programming" (not a book title, but something to search for ...) first.
Another good start would be "Design Patterns" but after you got familiar with the basics of OOP.
Some references on OOP:
... on design patterns:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With