Results 41 to 50 of 50
- 12-17-2011, 12:20 PM #41
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: Getting more than one "return" from a method
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2011, 12:39 PM #42
Banned
- Join Date
- Dec 2011
- Posts
- 143
- Rep Power
- 0
- 12-17-2011, 12:53 PM #43
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: Getting more than one "return" from a method
There's nothing in that post that even attempts to swap two objects (whether primitive or not), which I can fully understand because Java uses the pass by value mechanism and you can't swap two objects with that mechanism, no matter how much you want to obfuscate matters. It's the nuts and bolts of the language that define the details of the semantics of the language and everything on top of it.
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2011, 01:16 PM #44
Banned
- Join Date
- Dec 2011
- Posts
- 143
- Rep Power
- 0
Re: Getting more than one "return" from a method
If you want to keep thinking low level, that is fine. I understand your position. I am only interested in the wider picture.
The whole point of referencing post #40 is that your question swap a and b makes no sense on its own in an OO context. In OO you swap relationships, so you have to take into account what a and b are related to.
e.g
mum and dad swapped roles. i.e family.breadwinner and family.housespouse were swapped.
or
mum and dad had a body transplant. i.e mum.bodyContent and dad.bodyContent were swapped.
But just saying "Mr. and Mrs. Blow swapped" is meaningless from an OO perspective. It is a technical (and technically valid) fragment of a wider picture.
By all means insist that you only want to see the low level picture. But don't let that intrude on the OO discussion that you are not concerned about.
- 12-17-2011, 01:54 PM #45
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
Re: Getting more than one "return" from a method
Vague hogwash that only obfuscates the discussion; call by reference or call by value have nothing to do with object oriented programming by themselves but your understanding of how Java does things is just wrong. You don't even have your nuts and bolts facts right, so I don't believe you have the 'wider picture' right; your incomplete attempt of knowledge is just floating in thin air, and, indeed, I'm not concerned about your home cooked half religious hogwash.
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 12-17-2011, 02:12 PM #46
Banned
- Join Date
- Dec 2011
- Posts
- 143
- Rep Power
- 0
Re: Getting more than one "return" from a method
I don't mind rigorous discussion, but I can only discuss with people who don't take personally offense easily and start advancing ad hominem falsehoods.
So thank you for those who have not been swearing and ranting, but who have broadened my perspective on the issue.
- 12-17-2011, 02:13 PM #47
Senior Member
- Join Date
- Dec 2011
- Posts
- 102
- Rep Power
- 0
Re: Getting more than one "return" from a method
2by4,
If you haven't written what you wrote about the method changing the main array and if pbrockway2 wouldn't explain the thing with those oranges I'd have never figured out the problem in my program.
Thanks a lot guys!
it really was crucial to my understanding :|
- 12-17-2011, 02:18 PM #48
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 12-17-2011, 02:29 PM #49
Banned
- Join Date
- Dec 2011
- Posts
- 143
- Rep Power
- 0
- 12-17-2011, 11:01 PM #50
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: Getting more than one "return" from a method
You're welcome.
And sorry that I might have hijacked your thread somewhat. In your other thread I called it (the B[] array) a "shared object": think of it that way by whatever mechanism it comes to be shared. In my defence all I can say is that I tried really hard with the oranges not to raise the question of *how* it happens. But I shoulda known...
Similar Threads
-
connection = DriverManager.getConnection(DATABASE_URL,'"+userid +"','"+password+"');
By renu in forum New To JavaReplies: 3Last Post: 10-12-2010, 04:21 PM -
How to change my form design from "metal" to "nimbus" in Netbeans 6.7.1?
By mlibot in forum New To JavaReplies: 1Last Post: 01-21-2010, 09:20 AM -
[SOLVED] Why does the compiler return "not a statement" for this method body please?
By trueblue in forum New To JavaReplies: 3Last Post: 05-25-2009, 08:50 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks