Hey I'm wondering if it is possible to call a method from a its own class by the function name or something similar

Eg
Code:
public class Xyz
{
    public void foo()
    {
        this.cassMethodFunction("bar")
    }
    public void bar()
    {
        System.out.println("Hello World!");
    }
}