Hello Harshad,
I'm not into Java that much but can you not just use parseInt?
Otherwise you could use the parseInteger function in a Mendix activity to convert a string to an integer:
parseInteger('0')
Read more about it in the Mendix documentation: