boolean always returning false;

Ok so i have this

publicstaticboolean testAuth(){

try{

BufferedReader authReader =new BufferedReader(new FileReader("auth.txt"));

String auth = authReader.readLine();

authReader.close();

URL authUrl =new URL("http://hvc3.com/authTest.php?auth="+auth);

BufferedReader urlReader =new BufferedReader(new InputStreamReader(authUrl.openStream()));

String authResponse = urlReader.readLine();

System.out.println(authResponse);

if(authResponse =="active"){

returntrue;

}else{

returnfalse;

}

}catch (IOException e){

returnfalse;

}

}

this is my console outpot:

kevin-roses-computer:~/Desktop kevinrose$ java test

active

NOO

sorry its not the exception i dot knw whats wong:

Message was edited by:

krrose27

[1792 byte] By [krrose27a] at [2007-11-27 7:07:28]
# 1
Do not use == when comparing strings. Use the equals method instead.
floundera at 2007-7-12 18:58:52 > top of Java-index,Java Essentials,New To Java...
# 2
if(authResponse.equalsIgnoreCase("active")){
Jamwaa at 2007-7-12 18:58:52 > top of Java-index,Java Essentials,New To Java...
# 3

> > if(authResponse.equalsIgnoreCase("active"))

> {

>

And in this case just write:

return authResponse.equalsIgnoreCase("active");

:-)

-Puce

Pucea at 2007-7-12 18:58:52 > top of Java-index,Java Essentials,New To Java...
# 4
Just a small nit-pick about the title of this thread: a boolean does not return anything, a boolean just is (true or false).
prometheuzza at 2007-7-12 18:58:52 > top of Java-index,Java Essentials,New To Java...
# 5
> Just a small nit-pick about the title of this thread:> a boolean does not return anything, a boolean just> is (true or false).How very zen.
jverda at 2007-7-12 18:58:52 > top of Java-index,Java Essentials,New To Java...