String readStory(String tempstring){
         String tmpstring=null;
         tmpstring="123";
         tempstring=tmpstring;
         System.out.println(tempstring);
return tempstring;
}

解决方案 »

  1.   

    不可以,因为我的函数里有LIST、VECTOR、STRING等类型,都要返回的,但按照上面的方法调用RUN函数,我就得不到要的值了
      

  2.   

    回复人: szwwhui(szwwhui) 
    cannot return a value from method whose result type is void
      

  3.   

    用类的方法可以解决你的问题
    class yourclass{
    String m_tempstring1="";
    String m_tempstring2="";
    String m_tempstring3="";public void run(String urlstring) {
    readStory(urlstring);
    System.out.println(urlstring);
    }
    public void readStory(String tempstring){
             String tmpstring=null;
             tmpstring="123";
             m_tempstring1=tmpstring;//注意这里已改过
    m_tempstring2=tmpstring;
    m_tempstring3=tmpstring;
    //......         System.out.println(tempstring);
    }
    //读取你要的变量
    public String gettempstring1(){
    return m_tempstring1;
    }
    public String gettempstring2(){
    return m_tempstring2;
    }
    public String gettempstring3(){
    return m_tempstring3;
    }
    }
      

  4.   

    不行啊,是不是J2ME不支持RENTURN啊