• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nesting a method within a method

 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to nest a method within another method?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. What are you trying to accomplish by doing that?
 
Ismael Upright
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Order

I was just wondering. There are many possibilities in Java and I was thinking about this one.

Thanks for your answer.
 
Kelvin Chenhao Lim
Ranch Hand
Posts: 513
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can declare a local class within a method, and that class can have its own methods. That's probably the closest thing to a "method within a method" in Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic