| Author |
method definition inside main...
|
Sumesh Kumar T N
Greenhorn
Joined: Jan 26, 2005
Posts: 10
|
|
|
is it possible to define another method inside main???.....a friend of mine said that we could define "procedures"(???) inside main....im a bit confused...i am sorry if it is stupid...but lemme have a reply pleez
|
 |
Srinivasa Raghavan
Ranch Hand
Joined: Sep 28, 2004
Posts: 1228
|
|
There can be a class inside other class called nested class but you cant have a method inside another method. A suggestion, the best way to figure out issues like this is to write a simple code and compile it then you can learn lot .
|
Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
|
 |
Abhinav Anand
Ranch Hand
Joined: May 02, 2002
Posts: 113
|
|
Hi, I think your friend was talking about anonymous classes which can be declared and executed inside a method (no matter if it is done in main() method). Code snippet is given below: Hope this clears the doubt.
|
 |
 |
|
|
subject: method definition inside main...
|
|
|