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?

Sebastián Palma
  • 32,692
  • 6
  • 40
  • 59
Rajagopalan
  • 5,465
  • 2
  • 11
  • 29

0 Answers0