javascript like interface on java