If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Stuck on porting small segment of JavaScript to java

I'm fairly good at Java, but somewhat at a loss when the some of the JavaScript below is mentioned. I've attempted to port the below code, but I'm finding it somewhat difficult. Any help would be great :-)

Parts of JavaScript I'm stuck at porting:

1. I'm stuck on the return statement on the 3rd line.
2. Similarly the lines utilizing "charCodeAt", as I keep getting error "Cannot invoke charCodeAt(int) on the primitive type char"
3. Also on the second to last line, I keep getting the error "Cannot invoke padLZ(int) on the primitive type int".