There are two classes A & B. For example given below:
class A{
B b;
B getB(){ return b; }
}
class B{
String x = "Test";
String getX(){
return x;
}
}
I have object of A in .map(method_refrence_here_for_getX)
and I want to call getX so there is any way to do it?
Although i can do like below:
.map(A::getB)
.map(B::getX)
or
.map( a -> a.getB().getX())
But I want to do something like .map(A::B::getX)
I know it's absolutely wrong but I want something like this so anyone can help?