Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Team,
Could help me explain the difference between
row2.state.equals('Arizona') vs 'Arizona'.equals(row2.state)
in expresssion under tjoin inner join tab.
"Arizona".equals(row2.state) will never finish by a null pointer exception but row2.state.equals("Arizona") will fail if row2.state is null.
"Arizona".equals(row2.state) will never finish by a null pointer exception but row2.state.equals("Arizona") will fail if row2.state is null.
thanks TRF.
As TRF said, you should NEVER use the first one.
The second create a static String object, which prevent any exception, so you can do many operations like : !"".equals(row1.data)
The first syntax is a bad syntax and should be banned from all Java code you can ever find
You can use that trick in many situations if you're not sure of the nullability of your String.
Example : row1.data+"" will never be null, even if "data" is an Integer
Actually i was using this Arizona'.equals(row2.state) in tmap to only select rows with Arizona.
TMSSQLinput - tmap - MSSQLoupt
tmssqlinput (Lookup) - above tmap