• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Casting a String object to a Form object

 
Mutua Kakinyi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Srinath Gamage
Ranch Hand
Posts: 40
Google App Engine Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I see you have String values in Vector, so you cannot cast a String to a Form.
What you can do is add those strings to a Form object.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic