dcsimg
Convert vector to Object[] and to String[]
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bandita_Pradhan
Posted On:   Wednesday, September 10, 2008 12:03 PM

Hi, I have following code here. When I convert tmpValue to Object[] and tmpType to String[] , I am getting wrong values. So, my conversion is somewhat wrong. Can anybbody help me as I need it asap. Vector tmpValue = new Vector(); Vector tmpType = new Vector(); for ( int j = 0; j < mbeanInvoke.getParam().size(); j++ ) { MBeanParam param = (MBeanParam)(mbeanInvoke.getParam().get(j)); tmpValue.add( param.getValue()); tmpType.add( param.getType()); } System.out.println("tmpvalue is : " + tmpValue); Object[] tmpValue1 = new Object[] { tmpValue1}; System.out.println("tmpvalue1 is : " + tmpValue1); String[] tmpType1 = (String[])   More>>

Hi,

I have following code here. When I convert tmpValue to Object[] and tmpType to String[] , I am getting wrong values. So, my conversion is somewhat wrong. Can anybbody help me as I need it asap.

Vector tmpValue = new Vector();
Vector tmpType = new Vector();
for ( int j = 0; j < mbeanInvoke.getParam().size(); j++ ) {
MBeanParam param = (MBeanParam)(mbeanInvoke.getParam().get(j));
tmpValue.add( param.getValue());
tmpType.add( param.getType());
}
System.out.println("tmpvalue is : " + tmpValue);
Object[] tmpValue1 = new Object[] { tmpValue1};
System.out.println("tmpvalue1 is : " + tmpValue1);
String[] tmpType1 = (String[])tmpType.toArray(new String[tmpType.size()]);

My tmpValue1 and tmpType1 is coming wrong. Please help me.

Thanks,
Bandita

   <<Less

Re: Convert vector to Object[] and to String[]

Posted By:   Bandita_Pradhan  
Posted On:   Wednesday, September 10, 2008 12:11 PM

Hi,

Sorry , one of my statement becomes invalid. So writing the code again.

Vector tmpValue = new Vector(); Vector tmpType = new Vector(); for ( int j = 0; j < mbeanInvoke.getParam().size(); j++ ) { MBeanParam param = (MBeanParam)(mbeanInvoke.getParam().get(j)); tmpValue.add( param.getValue()); tmpType.add( param.getType()); } System.out.println("tmpvalue is : " + tmpValue); Object[] tmpValue1 = new Object[] { tmpValue}; System.out.println("tmpvalue1 is : " + tmpValue1); String[] tmpType1 = (String[])tmpType.toArray(new String[tmpType.size()]);

I still have problem. Please help.

Thanks, Bandita
About | Sitemap | Contact