• Post Reply Bookmark Topic Watch Topic
  • New Topic

Function in a function - ?  RSS feed

 
Em Aiy
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible to declare/write a function with in the function of some class? I am not talking about "anonymous classes".

If there is a way then can you post some sample code.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no. you cannot have nested function delcarations.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it in Pascal though! Do you want to switch?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!