now i know by testing that "w" prints before the equilty statement, but then "not w" prints next, any help would be great.
August 27th, 2004, 05:24 AM
skiddieleet
lol http://java.sun.com/j2se/1.4.2/docs/...ng/String.html
public File(String FileName, String mode){
System.out.println(mode);
if(mode.equals("w")){
System.out.println(mode);
OpenWrite(FileName) ;
}
else{
System.out.println("not w");
OpenRead(FileName) ;
}
}
Strings are objects, you can only use == with primitive data types like int, double and boolean. If you're taking a class you will learn all about comparing objects, should be good for you :). Peace.
August 28th, 2004, 01:30 AM
gothic_type
Actually h3r3tic, you are technically incorrect in saying that you can only use == with primitive data types. You "can" use == to compare objects, but with objects, == evaluates whether or not two objects are exactly the same; (as in same memory address, etc.) at least that's what I believe is the case.
But hey, that was a pointless comment from me...just being pedantic :) I figure if I write this reply I might actually be able to get to sleep.