Condition is wrong pliz help | SoloLearn: Learn to code for FREE!

+2

Condition is wrong pliz help

eg class A{ } class B{ public static void main(){ int a; A aa = new A() ; If (a == aa){ } } }

12/18/2017 3:19:30 PM

Medo Myrtle

2 Answers

New Answer

+5

Yep, different datatypes don't match

+3

a is an primitve type integer, while aa is of type A. integer =/= A you'll always get false.