mathod == function
We call it that when we put it into an object..
I have been programming in C and Perl for a long time now, but haven't touched any Object Oriented languages yet. Now I started learning Java 2 programming. I've read a lot of tutorials but I'm still not grasping the concept of Object Oriented programming.
Can somebody tell me what a method is? Looking at the code it looks like a function in C or Perl. In that case why is it called a method and not a function? What is the difference? None of the tutorials explained this.
mathod == function
We call it that when we put it into an object..
Ok, so when you say "Call the main method of the HelloWorld class" it would mean "Call the main function in the HelloWorld module?".
Yeah, kind of. Methods are just like functions, but they are part of a class
You should get some better tutorials, sounds like the ones you're reading suckWhat is the difference? None of the tutorials explained this.![]()
Yes, I've come to that conclusion. They start talking about this and that method of a class right away before defining what the hell a method is.
You should get some better tutorials, sounds like the ones you're reading suck![]()
Let's see if we can find some for you... Well, I could send you some, but they are in Danish
Yes, I've come to that conclusion. They start talking about this and that method of a class right away before defining what the hell a method is.![]()
Actually, I'm reading one right now here: http://www.ibiblio.org/javafaq/javatutorial.html
It looks pretty decent.
http://www.ibiblio.org/obp/thinkCScpp/
Here's one for C++
All right I'm getting ahead in Java. I came across a problem that I haven't found a solution to yet. In the following code I'm returning the value of "a". But how can I return the value of both "a" and "b"?
Code:public class test { public float test() { float a = 1.1; int b = 1; return a; }
Bookmarks