change java snippet to create class with public visibility