Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Java] Objects
#5
Spaz Wrote:I am assuming that you mean "compile" when you say "decompile". I am guessing that those summaries are just supposed to be descriptions of what the method does. You didn't ask about "public boolean equals" or "public String toString()" so I'm assuming that you're comfortable with the concept of functions that return a value. "void move" is just a function that doesn't return any value.

Is it supposed to be "public void move" or is it supposed to not have an access specifier?

You would call move like so:

Point point = new Point(5, 5); // Create the Point object
point.move(10, 15); // move it

1) Oops, meant compile.
2) I have no idea what those are, either D=.
3) It's supposed to not have an access specifier, I guess. I have no idea, really. I just copy pasted.

So say I have variable pointA. To use this class, would I do something like, pointA.equals(....I'm guessing Point goes here)? And pointA.toString(...I'm also guessing Point goes here?)

Kalovale Wrote:I've had at least 3 sources telling me stuff about Objects (the Sun tutorial, my cousin and my instructor), but the idea never really clicked until I figured it out for and by myself, so I'm not sure how much help I'll be, but I'll relay my understanding of OOP here.

 subject to conceptual derp

Well, thanks, that makes a lot more sense than what my teacher tried to teach us X_X. Now I just need to figure out how to use this class Point. Starting to read the textbook, finally.
Reply


Messages In This Thread
[Java] Objects - by Corn - 2011-10-24, 11:30 AM
[Java] Objects - by Spaz - 2011-10-24, 06:15 PM
[Java] Objects - by Spaz - 2011-10-24, 06:15 PM
[Java] Objects - by Kalovale - 2011-10-24, 06:40 PM
[Java] Objects - by Corn - 2011-10-24, 07:58 PM
[Java] Objects - by Spaz - 2011-10-24, 09:46 PM
[Java] Objects - by Kalovale - 2011-10-26, 12:53 AM
[Java] Objects - by Corn - 2011-10-26, 04:58 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)