Varun K. Gupta wrote:use name=input.next();
It will not work in case name contains more than one word....
One question why you extends Object class ? There is particulary no need of it. Object class is a super class of every class so each class will inherit all its property. Extends should be used carefully as we can use for extending only one class
Thanks for answering Varun,
i Extended Object class because of knowing simple you have knowledge about that i know you have defined that class in your feedback , it was a simple example for let me remmember that Object class is super class for all classes all classes are extending Object class properties.
Your answer was well but not complete i know that it will work but not as i want it to work,
it should accept spaces between name you know.