public void info(Object s) { System.out.println(String.format("Tree No. %d , Object method, parameter: %s", number, s.getClass().getSimpleName())); } Guys, it is the space after - @Tree No. %d ,@- do you see it, that's how it should be for all. Also the end should be @paramter : %s@