I am trying to understand a program in java which has used lambda to return object into the reference variable of an interface. I want to convert lambda into simple java function, but not sure how to do it.
The program is as follows:
public abstract class Performance implements Serializable
{
InterfaceName vehicle =(InterfaceName & Serializable) () ->{return new Object();};
Object speed()
{
return vehicle.speed();
}
}
The interface is as follows:-
public interface InterfaceName
{
Object speed();
}
How could I convert this program into a simple Java program without use of a lambda, as a learning exercise?