Casting a String object to a Form object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mutua_Kakinyi
Posted On:   Thursday, April 21, 2011 05:32 PM

Am trying to read Vector values and cast them to a Form object. The following is an example code that am building.



public void testMe() {

String str = null;

Vector listOfFormsVector = xml.getForms();

for (int i = 0; i < listOfFormsVector.size(); i++)
{
str = (String) listOfFormsVector.elementAt(i);

Form str = (Form)new Form("Am testing");

}

}


Is it possible to cast String objects to a Form object? How else do I make these string variables Form objects?



Mutua

Re: Casting a String object to a Form object

Posted By:   Anonymous  
Posted On:   Thursday, May 5, 2011 11:43 AM

i think so it will give error.
any way you can try like that
str=(String) listOfFormsVector.elementAt(i);
Form strobj=new Form(str);
it is creating the form as local object
any what is usage of creating form in your task?
About | Sitemap | Contact