jQuery in Action, 2nd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Local method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Local method " Watch "Local method " New topic
Author

Local method

Sudhakar Krishnamurthy
Ranch Hand

Joined: Jun 02, 2003
Posts: 76
Hello:
Is it possible to have a local method on same lines of a method-local inner class, i.e. a method inside a method, if so how does it look? examples will be appreciated.
Thanx,
-S
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
Nope
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Methods can only be enclosed in classes or interfaces.
Stephen Galbraith
Ranch Hand

Joined: Oct 27, 2003
Posts: 90
Not directly (as has been said already),
but you can define anonymous inner classes, that can "look" similiar to what I think you're talking about....


SCJP 1.4, SCJD, SCWCD 1.4
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Local method
 
Similar Threads
Threads Q
IS CONCTRUCTOR IS A METHOD
Did implicit objects are instance variables or local variables in _jspService
Method local Inner Class
final local variable question