Question :Can main() of one java program be invoked in another java program's
main()? (CoreJava)
Answer :Yes, This is possible. Have a look at the below code
package corejava;
public class A
{
public static void main(String args[])
{
System.out.println("in A");
}
}
package corejava;
public class B
{
public static void main(String args[])
{
System.out.println("in B");
String str = "one,two";
String[] strArray = str.split(str);
A.main(strArray);
}
}
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
Can main() of one java program be invoked in another java program's
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment