static 
    {
        _HumanInstance = new HumanInstance();
        _HumanInstance.go();
    }

解决方案 »

  1.   

    看清楚这样的定义哦。楼上的老大能介绍一下吗?
    public class humans
    {
        ..........    static 
        {
            _HumanInstance = new HumanInstance();
            _HumanInstance.go();
        }}
      

  2.   

    这不应该是一个内部类吧,应该是一个变量的定义吧.如果是内部类,至少也的有修饰符 class 啊
      

  3.   

    WxmJun(胡扯之) 说的对,类被加载就执行了,你去看看类的初始化,new一个对象的时候最先执行的就是这种代码
      

  4.   

    _HumanInstance = new HumanInstance();  --建立一个对象
            _HumanInstance.go();    --调用对象方法
    静态执行,加载类即执行 _HumanInstance是在哪定义的呢?
      

  5.   

    确切的说:类构造函数。
    我们平常所说的构造函数就是 非 static的 构造函数。呵呵~~
      

  6.   

    <tr> 
      <%set com=server.createobject("adodb.connection")          
    com.open "DBQ="& Server.MapPath("data.mdb")  &";Driver={Microsoft Access Driver (*.mdb)}"        
    if request("ok")="ok" then response.write "hello"   
    set rs=com.execute("select*from main where user>=#" & date & "# ORDER BY id DESC")   
    page=request("page")      
    newpage=0  
    if page="" then page=1 
    do while newpage<page*101-101
    newpage=newpage+1      
    rs.movenext      
    loop  
    do while not rs.eof    
    i=i+1%>  
            <td width="435" height="26" valign="middle" bgcolor="#F0F0F0"><span class="f14"><a href="<%response.write rs(2)%>" target="_blank">
              <%response.write rs(1)%> 
            </a></span><font color="#FF6600">&nbsp;</font></td> 
         
      </tr> 
    <%if i=100 then exit do    
              
    rs.movenext             
    loop%>  
    请问如何实现循环到5条信息的时候换行啊???换行啊
      

  7.   

    静态初始化详细情况《thinking in java》有讲
      

  8.   

    注:
    public class InchesToFeet
    {
       private static final int inches=12;
       protected InchesToFeet()
       {       
       }
       public static double convert(double in)
       {
          return(in/inches);
       }
       static
       {
          System.out.println("这是首先执行的静态块!");//可以写多个  例:
       }
       static
       {
          System.out.println("这是首先执行的静态块第二个!");
       }
       static
       {
          System.out.println("这是首先执行的静态块第三个!");
       }
       public static void main(String[] args)
       {
          double inch=66;
          double feet=InchesToFeet.convert(inch);
          System.out.println(inch+"inch is"+feet+"feet.");
       }
    }
    简单小例子能明白吗!那个静态块在第一次使用类时执行,可以写多个,这个功能在有些情况下用起来很方面!自己想吧!