num1 is not an Object, let alone an object with the length() method, and thus the compiler is telling you it can't be dereferenced.

Note you can set num1/num2 to one/two.length() Besides that...