Welcome to the Ranch
Please use the
code button, in which case the code will look like this:-
Younis ahmed wrote:. . . I am trying to use lambda functions inside map to copy value of object from one to another object, I have expressions like
a.b.p1 =d.e.d1
or
a.x1 = d.e.d2;
. . . .
Who gave you that code? Please always tell us
where such code comes from. There is nothing good one can say about that code, neither in terms of style nor of design. Assuming those two classes are in the same package, they have access to each other's implementation details because their fields aren't private. Also, the use of inner classes makes that code difficult to execute. If you are still going to use inner classes, go through the
Java™ Tutorials and see how to instantiate them. And I am not even starting about style things.
I can see all sorts of errors in the copying code “a.x1 = d.e.d2;”: you are confusing inner and outer classes, you are confusing static and instance fields, and you are confusing different types.
Why are you calling that a λ function? It doesn't look like a λ to me. What do you mean about being in a map?