Main方法是用static修饰的,有2种方法可以调用

1.类名.main(参数);

2.new创建实例,实例.main(参数);

这个地方注意必须传递字符串数组的参数 或者 null !
另外举一个用反射机制调用Main方法的例子

这个类是被调用的main方法类:
Java代码

public class Run   

    {     

          public static void main(String[] args)   
         {     
             String str=args[0]+"Hello World";     
             System.out.println(str);     
        }     

    }  
下面是调用main方法的类:
Java代码  

    public class JobRun   
    {     
        public static void main(String[] args)   
       {     
            String idStr = "YAya";     
               try   
              {     
                   Method method = Run.class.getMethod("main", String[].class);     
                   method.invoke(null, (Object) new String[] { idStr });     
               }   
               catch (Exception e)   
              {     
                  e.printStackTrace();     
               }     
       }     
    }