2

I am trying to get my sltag value but I got some errors in my code. Please help me solve this error.

I have one XML file. I want to display that XML file node value one spinner and child node value value one tab etc... so I am using a SAX parser.

error lines

public ArrayList<Subchild> getSLTag() {
    ArrayList<String> SLTag = new ArrayList <Sting>();
    for(int i = 0; i<xmlTagInfo.size(); i++);
    SLTag.add(xmlTagInfo.get(i).sltag);
}

2nd and 4th line error error is

  1. Multiple markers at this line

    • Sting cannot be resolved to a type
    • ArrayList cannot be resolved to a type
  2. i cannot be resolved

balaji
  • 1,555
  • 5
  • 26
  • 49
  • 1
    Can you improve your question by correcting obvious mistakes? I can only speak for myself, but I don't like to read questions that are hard to read/understand because of poor language. – migu Jan 20 '12 at 12:32
  • 2
    For our sake and yours, please use an IDE. – Perception Jan 20 '12 at 12:35
  • @migu Couldn't agree more. I just move to another question now. – Ricky Jan 20 '12 at 12:37
  • And this question is ***very*** similar to http://stackoverflow.com/questions/8574402/error-type-mismatch-cannot-convert-from-arraylistsubchild-to-arrayliststrin. It even shows up in the right hand side related questions. – Perception Jan 20 '12 at 12:37

3 Answers3

1

The other answers already gave some solutions. What's more:

for(int i = 0; i<xmlTagInfo.size(); i++);

should be

for(int i = 0; i<xmlTagInfo.size(); i++)
Ben van Gompel
  • 747
  • 4
  • 12
0
  1. You have misspelled String in your code. You have placed Sting. (cool guy by the way, love the song "Fields of gold")
  2. To use ArrayList you need to include import java.util.ArrayList at the top of your sourcecode
ŁukaszBachman
  • 33,595
  • 11
  • 64
  • 74
0

it's spell mistake in this statement

ArrayList<String> SLTag = new ArrayList <Sting>(); // check the spell

it's String not Sting

ArrayList<String> SLTag = new ArrayList <String>();
Pratik
  • 30,639
  • 18
  • 84
  • 159