What does this mean in JAVA and how to pass it to PYTHON

-1

I have to pass this Java code to Python but I really do not know what it does:

String row = (String) sprite[i];

We have that sprite is a vector and this is in a cycle for , so my variable i is the one that will be increasing.

    
asked by J.Gama 05.07.2016 в 19:29
source

1 answer

3

It means that the variable row is getting the value i of vector sprite and that this value was converted to String .

Example:

int i = 0;
int sprite = [1,2,4];

// es igual a 1 pero con tipo String
String row = (String)sprite[i];

And it can be translated to python with:

row = str(sprite[i])
    
answered by 05.07.2016 / 19:35
source