HI,
The following code is run well but how ??Because i Right 2 main method in
single class pl z explain this in brief ,
public class TwoMains
{
/** This class has two main methods with
* different signatures */
public static void main (String args[])
{
//required prototype for main method
System.out.println("Hello world!");
int i;
i = main(2);
System.out.println ("i= " + i );
}
/**This is the additional main method*/
public static int main(int i)
{
return i*i;
}
}
Thanks in advance.
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en