当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·我想做斑竹,应该如何做呢    »显示摘要«
    摘要: 请大家告诉我。 谢谢! 谢谢! 谢谢! ......
    摘要: help me!如何在系统中注册控件!系统中没有装vc! ......


自定义函数调用问题

public   void   run(String   urlstring)   {  
  readStory(urlstring);  
  System.out.println(urlstring);  
  }  
  public   void   readStory(String   tempstring){  
                    String   tmpstring=null;  
                    tmpstring="123";  
                    tempstring=tmpstring;  
                    System.out.println(tempstring);  
  }  
   
  上面的函数打印出来是“123”,“null”  
  我现在要让tempstring作为返回值,怎么改?因为我现在可能有很多参数作为返回值,所以我必须把要得到返回值用参数形式表示,就想上面的urlstring一样,要让它等于“123”

NO.1   作者: szwwhui

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

NO.2   作者: newman0708

用类的方法可以解决你的问题  
  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;  
  }  
  }


    摘要: 有两个表,graph1,graph2,graph1有整形field t1,graph2里有整型field t2. 以下找错 select t1 from graph1 where graph1.t1<graph2.t2 必须用到graph1.t1 ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE