TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manikandan
NA
5
0
Reg - Reflection in array of objects
Mar 26 2013 6:26 AM
Hi,
I have a class which is array of classes. I need to traverse object of this class and do the following:
a. Instantiate object with total number of array size.
e.g. student[] stu = new student[2];
b. Instantiate each array item in a object
stu[0] = new student();
stu[1] = new student();
c. Then will assign value to its properties. Like
stu[0].name = "Test";
stu[1].name = "Test1";
This is easy and done simply. But i want to do the same in Reflection, where object will be passed without memory allocation and also its instances. As follows:
student[] stu;
assignValue(stu);
public function assignValue(object studentObj)
{
/*
a. Instantiate object with total number of array size
b. Instantiate each array item in a object
c. assign value to its properties
*/
}
How to achieve this? I tried to set memory allocation and instantiation of each item, but am unable to set value to the object. Can anyone help me?
Thanks and Regards,
Mani
Reply
Answers (
1
)
Difference between Const, ReadOnly and Static ReadOnly?
Page culture issue