public class networking2{
public static void main(String []args) throws IOException{
String urlLink = "http://rocktheparty5231.xtgem.com/out";
URL url = new URL(urlLink);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
while((line = in.readLine()) != null) {sb.append(line);}
in.close();
// problem is here
System.out.println(sb.toString()); // sb is returning output "uc"
System.out.println(sb.toString()=="uc"); // how is this boolean false
// i am not able to do any boolean operation with this correctly please help
}
}
http functions are working perfectly but the boolean is not working as it should work