move democode from f.java to demo1.java