mardi 14 novembre 2017

How can i do for with long value

I need to do codes with for loop and long value like this:

for(long i=1;i<lines.length; i++){

    char tmp = lines[i].charAt(lines[i].length()-1);

            int index = lines[i].lastIndexOf(" ");


  lines[i] = lines[i].substring(0, index);



    if(tmp != lastChar)
        lines[i] = "S" + lines[i];
    else{
        lines[i]=" "+lines[i];
    }


    lastChar = tmp;


}

The problem is: incompatible types:possible lossy conversion from long to int I dont know how to fix it

Aucun commentaire:

Enregistrer un commentaire