set constructor function to be public

otherwise it can not be called outside its package
implement demo.java