This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
In what cases can it return null? Im testing this from my eclipse IDE and not able to simulate a case when it can return a null so that it can fail.
Joined: Mar 22, 2005
From the javadocs:
A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached.
Joined: May 29, 2008
thanks for replying, i am unable to solve the problem as pallavi said i have used input.equals("") but this is not the only one condition in which it needs to work. If the user gives the input as a space or a tab or 2 or mare spaces or 2 or more tabs it does'nt work. I have also used the trim() method i.e input.trim() also insane. Some body please help me out