= and == difference in If statement Java

后端 未结 5 1215
感情败类
感情败类 2021-01-19 04:39

I am facing something strange here. Please help me understand if I am missing something. My if condition was supposed to be:

if(configuredPdf == true)
         


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 05:11

    configuredPdf must be a boolean for if(configuredPdf = true) to compile.

    configuredPdf = true will assign true to configuredPdf and thus if will succeed.

提交回复
热议问题