Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

access java method with number

Name: Anonymous 2006-06-10 5:54

how to access a java method with a number, since i can't seem make a method array or pass a method reference

Name: Anonymous 2006-06-10 5:58

Sounds like you're suffering from functional envy. Java doesn't support such high level abstractions. Sorry :(

Name: Anonymous 2006-06-10 6:03

damn
thanks for your reply

i'll use a switch (at least it's better than ifs that was here previously)

Name: Anonymous 2006-06-10 15:37

>>1
Lol Javur

Move on to some real language. Multiparadigm languages like Python, Ruby or Lisp should be good.

Name: Anonymous 2006-06-10 16:24

>>4
Given that he knows about passing functions as arguments, I'd assume that >>1 is a functional programmer who is being forced to use Java for some reason. You, on the other hand, are just a random Java basher who hasn't written anything more complicated than 100.times { print "JAVUR SUX LOL" }

Name: Anonymous 2006-06-10 16:58

>>5
I don't know Ruby

Name: Anonymous 2006-06-10 17:00

That doesn't make >>4's comment any less true.

Name: Anonymous 2006-06-10 19:40

>>6
Then you fail.

Name: Anonymous 2006-06-11 19:02

use a function object. by using inner classes, i think you can get the same functionality as closures (it's just rather verbose...)

Name: Anonymous 2006-06-12 9:28

>>9
*smack*

Name: Anonymous 2006-06-12 13:01

i'm now using switch statements that call methods
oh well at least it's better than the original 'if' puzzle
>>6 is not me
>> 9 what do you mean

Name: Anonymous 2006-06-12 13:35

>>9 gave you an awful, ugly solution, if it is one. Do not listen to him from now on.  The switch that calls methods is a good idea.

Name: Anonymous 2006-06-13 5:46

Every time you need to do:

switch (lol) {
 case 'harbl': harbl(); break;
 case 'rofl': rofl(); break;
 case 'fap': fap(); break;
}

type things, you realize the language you're working with is shit.

Name: Anonymous 2006-06-13 5:49

this is why i posted here >>13
in other languages i am able to either put methods inside arrays or even pass them. see >>2

Name: Anonymous 2006-06-13 15:24

Why would you need such a braindamaged concept like making functions variables? You don't call variables, they are values, while functions are code. Don't mix code and data, stupid, that leads to exploits. Learn to code.

Name: Anonymous 2006-06-13 15:34

>>15
for efficiency, dumbass.  sometimes it's faster to call a function via a function-pointer array than to do a series of "if-then"'s or "switch"'s.

Name: Anonymous 2006-06-13 15:50

>>15 make some valid points instead of insulting me?
at least know what you're talking about?
exploits? what are you talking about?

Name: Anonymous 2006-06-13 15:57

>>16 WTF is wrong with if-else? It's how a lot of languages handle branching code, not just C and JAVA. Also, anything can be "sometimes faster" when used right.

If you really want an array of function pointers learn C/C++; it can do that without a problem.

Name: Anonymous 2006-06-13 17:30

>>16-17
Sheesh, people, don't you realize I was trolling? Lol, c'mon, my >>15 was a good troll, I intentionally mixed concepts and shit.

Name: Anonymous 2006-06-14 0:45

>>19
Fuck you, dumbass, mixing concepts and shit.  Can't you make logical statements that concentrate on one thing at a time.  I swear, you must be a Eurofag.

Name: Anonymous 2006-06-14 8:48

oh i didn't realise you were trolling, i thought you were being honest, i just didn't understand what you meant

Name: Anonymous 2006-11-14 21:17

Lol Javur

Name: Anonymous 2010-06-07 6:41

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: Sgt.Kabuﷰꬎkiman섰 2012-05-28 19:17

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List