-
August 26th, 2004, 10:46 PM
#1
Member
Java syntax question
i am trying to check a string to see if it is equal to "w" but it wont work.
public File(String FileName, String mode){
System.out.println(mode);
if(mode == "w"){
System.out.println(mode);
OpenWrite(FileName) ;
}
else{
System.out.println("not w");
OpenRead(FileName) ;
}
}
now i know by testing that "w" prints before the equilty statement, but then "not w" prints next, any help would be great.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|