Hello, I want a list of all the oeprand types that can be compared and would not give me a compile time error. For this I tried checking the Java Language specs. I could see order of operantions, precedence etc. I wonder if such kind of information is available in specs. I feel it should be. Anyone who has come across such information in the specs? Thanks and Regards, Leena
Alongwith being a good coder, try to be a good professional as well!
Compared -- using what? The '<' operator and friends? The JLS will tell you (all primitives except booleans, I think); the conversion rules will tell you exactly how the language handles mixed types. With compareTo()? Aything that is Comparable. This is something for the API specification rather than the language specification, and you can find a list of Comparable classes in the core API at the top of the javadoc page. - Peter [ June 27, 2003: Message edited by: Peter den Haan ]
Joined: Mar 13, 2003
May be I should make it more clear. I am after wirting a condition parser. If I have - i and str, I have to decide whether they can be compared. can the spec help me in it? Tina