I have below sample classes in my application:
class A {
Integer a
String b
Integer c = (a < 5) ? a+5 : a+10
}
class B {
void method1() {
A a = new A(a:4, b:"test")
log.print("c: ", a.c)
}
}
When my code is calling method1, then it outputs c = 14. but ideally it should 9.
How we can solve this without explicitly setting value for c? Thanks in advance!