Query relating to checking whether or not an inventory is empty or now not?

Why does not this way paintings

void major() {
Record l1 = [];
if(l1 == [])
print(‘Record is empty’);
else
print(‘Record isn’t empty’);
}

however this does

void major() {
Record l1 = [];
if(l1.isEmpty)
print(‘Record is empty’);
else
print(‘Record isn’t empty’);
}

Why does the primary way all the time consequence within the execution of the else block?



View Reddit by means of psychobacterView Supply

You may also like...

WP2Social Auto Publish Powered By : XYZScripts.com