A single “=” is used to declare a variable and assign a value to it. You can use this to set a variable to null.  A value of “0” and null are not the same and will behave differently. variableName = null; A “==” is used to check that the two values on either side are equal. If you set a variable to null with “=” then checking that the variable is equal to null would return true.  variableName == null; You can also use “!=” to check that a value is NOT equal. The result of the expression will be a boolean (true or false) value. You can use the boolean value as a condition for what the statement does next. For example, if the value is null, then print text “object is null”. If “==” does not find the variable to be null, then it will skip the condition or can take a different path.   Object object = null ; if ( object == null ) { System.out.print ( "object is null "); }
استخدم = لتعريف المتغير. استخدم == للتأكد من قيمة المتغير. استخدم قاعدة if لكي تخلق شرط اللاشيء.