The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2000



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


code to your answer

Posted by ruchi and hema on November 15, 2000 at 9:05 AM

> hi ...

> here is code that u may want...

class c {

static void main(String ag[]){
int a= 10;

> class b{
> static void method(){
> String d[] = new String[10];
> c.main(d);
> }
> static void main(String args[]){
> b.method();
> }

> }

> so may be this is code that u want..even u can do recursion
> too..with main().we have done this code on note may u find some compilation remove that..hope u got some idea...

> thanX
> ruchi and hema

> Suppose somebody has written a class which is the public class for that file(it has the main() method). How can i call the main() method of that class? I know it can not be done directly but then why can't it be done ... Will i be violating any of the rules of OOPs?

> > thanx
> > abcd

  • thanx abcd November 18, 2000 at 8:02 AM (0)

Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us