Abstract function parameters in Java?

I am not really sure how to phrase this question-- is there a way to pass in straight text into a function in Java?

For example, if my function was called diff, instead of

diff("8*x + x^2");

it would look like

diff(8*x + x^2);

and then the function would convert the input to a String?