Ok, a few things:
1 void is not the proper return type, it should be a String (it would be a double, but once you pad it with zeros, then it's a string:
public String gridrefNumToLet(int e, int n, int digits)
2 You can return a single quote with nothing in it. so change line three to null:
if (e100k<0 || e100k>6 || n100k<0 || n100k>12) return null;
3 I don't know what this is supposed to do, but you're assigning a String to a double variable, so it needs to be converted to double if you're going to use it:
double letPair = String.fromCharCode(l1+'A'.charCodeAt(0), l2+'A'.charCodeAt(0));
4 padLZ is not a method in Java. You'll need to use a String formatter to do that:
String pattern = (I am not sure how many digits you'll need, but you can find lots of resources on string padding.)
return String.format(pattern, gridref);