Sobes.tech
Junior — Senior

Creating list B from A with an even y field and calculating y = 3·x/2

livecode

Task condition

It is necessary to build a list listB, selecting from listA only those elements for which the calculated value y is even. The value y is calculated using the formula y = 3 * a.x / 2.

public class A{ public int x;}
public class B{
    public int y;
    public B(int y){this.y=y;}
}

List<A> listA = List.of();
List<B> listB = listA