convenience method for java programing