如何通过属性将数组值从一个类传递到另一个类 [英] how to pass array values from one to another class through property

查看:71
本文介绍了如何通过属性将数组值从一个类传递到另一个类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我使用的是3层架构,所以有3个类,例如Class1,Class2和Class3.

在class3中,我通过Class2中定义的属性加载数组值.现在,我想在class1中检索相同的值.请使用示例

hi all,


i''m using 3-tier architecture,so have 3 classes like Class1,Class2 and Class3.

In class3,i''m loading the array value through properties which are difined in Class2.Now i want to retrive same value in class1.please reply with an example

推荐答案

财产应该是公开的.如果Class3可以访问Class1,则只需使用Class1的属性. (并且拥有3个类并不一定意味着您正在使用N层范例.)
Properties are supposed to be public. If Class3 has access to Class1, just use Class1''s properties. (And having 3 classes doens''t necessarily mean you''re using a N-tier paradigm.)


在class3中,我通过属性加载数组值现在我想在class1中检索相同的值.请举一个例子.

我想您的问题本身就有答案.您说-通过Class2的属性,您正在Class3中加载数组值.那么,是什么使您无法使用相同的Funda在Class1中加载该数组?

它可能是您在某个地方犯了错误,还是在我的头脑之外.
In class3,i''m loading the array value through properties which are difined in Class2.Now i want to retrive same value in class1.please reply with an example .

I guess your question itself has an answer.You say - Through properties of Class2, you are loading an array value in Class3.So, what is blocking you from using the same funda to load that array in Class1?

Its either you have mistaken somewhere or am out of my mind.


这篇关于如何通过属性将数组值从一个类传递到另一个类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆