Hello all
can anybody tell me why i am getting null pointer exception.
String mesg="";
try
{
URL u = new URL(strOp);
BufferedReader r = new BufferedReader(new InputStreamReader( u.openStream()));
String s="";
while((s=r.readLine())!=null)
System.out.println(s);
if(s.equals("SUCCESS"))
mesg = mesg+"Your Request has been Processed.you will be intimated by a sms soon";
else
mesg = mesg.concat("Service is not available.Please try later");
}
when i print the value of s it is giving "SUCCESS".But when assigning the string to mesg it is giving nullpointerexception