0

I am coming from Ruby background. I have something like this in Ruby

For example, this is a method definition:

def fun
  puts 'Raja'
end

Now this is a method calling:

fun

Instead of calling fun, I can call the function as I have given below

send "fun"

This send "fun" will call the fun as well. The advantage of doing it this way is I can pass the function name also as a parameter. Is there any way I can achieve the same in Java? Or Is there any alternative found in Java?

de-russification
  • 31,008
  • 6
  • 34
  • 52
Rajagopalan
  • 4,496
  • 2
  • 7
  • 25

0 Answers0