Sorry if my question is silly or not it doesnot matter. But i just want to know what will happen in these two conditions.
public class Test {
public stat
They do pretty much the same.
The only difference is that the first example uses the equal() method of the string object "str" with the "test"-string as parameter while the second example uses the equal() method of the string "text" with "str" as parameter.
The second variant can't throw a NullPointerException since its obviously not null.