且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何从这个课堂上获得这个价值

更新时间:2023-02-23 19:22:20



您能用更具体的语言来阐述您的问题吗?我得到的印象是,您要求从容器类的内部类访问变量.

如果我猜对了您的问题,那么您应该访问上述代码中的方法tick:

App.ClockI时钟=新的Ap.ClockI();

//clock.tick ....
Hi,

Can you elaborate your question by more specific language? I got impression like you are asking to access variable from inner class in a container class.

If I''m guessing right about your question then you should access method tick in above mentioned code:

App.ClockI clock = new Ap.ClockI();

// clock.tick....


我不知道日期变量来自
但是如果它从此类中获得价值的话
我认为***的方法是将其公开,然后您可以获取或设置其值
i didn''t hnow date variable where came from
but if its get its value from this class
i think best way to do that be make it public and then you can get or set its value
public class App : Ice.Application
{    
public class ClockI : ClockDisp_    
{        
public string date;
public override void tick(string tempdate, Ice.Current current)        
{ 
date=tempdate; 
System.Console.Out.WriteLine(date);            
string[] stringreceived = date.Split('','');        
}       
 System.Console.WriteLine(intreceived);    
}
}


并以其他形式
App newapp=new App
所以你可以使用
newapp.date


and in other form
App newapp=new App
so you can use
newapp.date