I found this example on a web page
Enumeration enum=v.elements ();
while(enum.hasM oreElements())
{
String elemento=(Strin g)enum.nextElem ent();
if(elemento.equ als("tres"))
{
System.out.prin tln("Encontrado tres");
break;
}
}
but when i paste into my code and execute it throws this exeption
java.lang.Class CastException: java.util.Vecto r
at Layout2.documen tLines(Layout2. java:282)
at Layout2.obtiene Cadena(Layout2. java:200)
at Layout2.generaD ocumento(Layout 2.java:78)
at LanzaLayout.mai n(LanzaLayout.j ava:241)
Exception in thread "main"
Please help
Enumeration enum=v.elements ();
while(enum.hasM oreElements())
{
String elemento=(Strin g)enum.nextElem ent();
if(elemento.equ als("tres"))
{
System.out.prin tln("Encontrado tres");
break;
}
}
but when i paste into my code and execute it throws this exeption
java.lang.Class CastException: java.util.Vecto r
at Layout2.documen tLines(Layout2. java:282)
at Layout2.obtiene Cadena(Layout2. java:200)
at Layout2.generaD ocumento(Layout 2.java:78)
at LanzaLayout.mai n(LanzaLayout.j ava:241)
Exception in thread "main"
Please help
Comment