I need to compare the fields and depending on that if its true then update a boolean variable and if its false then capture this field and get the label and append it to a string. I have like 10-12 field values to compare, so is there a way to minimize the number of If statements we use?
If(obj1.var1 == obj2.var1){
booleanVar+= true
}else{
stringVar+=obj1.var1
}
If(obj1.var2 == obj2.var2){
booleanVar+= true
}else{
stringVar+=obj1.var2
}
'
'
'
'
'
If(obj1.var10 == obj2.var10){
booleanVar+= true
}else{
stringVar+=obj1.var10
}