Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can anyone point me in the direction of a GOOD java functions/objects/methods tut? [closed]

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

like image 936
MK3GTX Avatar asked Dec 08 '25 21:12

MK3GTX


1 Answers

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:

  • http://en.wikipedia.org/wiki/Object-oriented_programming
  • http://docs.oracle.com/javase/tutorial/java/concepts/
  • http://www.aonaware.com/OOP1.htm

... on design patterns:

  • http://www.oodesign.com/
like image 141
Fildor Avatar answered Dec 10 '25 10:12

Fildor