Use of the reserved word assert on android [duplicated]

0

I have a question and it is that the IDE AndroidStudio marks some warning when the line of code can produce a null result, in that case it suggests a assert variable != null the question is whether it would have the same meaning as saying:

if (variable != null){

}
    
asked by Igmer Rodriguez 18.11.2018 в 06:19
source

1 answer

1

I was wanting to answer you but in this answer you will find more details about the difference between the assert that is executed in execution time while the conditional of the if does that if it is not in that context ignore it.

Answer on the difference between assert vs null

    
answered by 18.11.2018 / 06:29
source