I am aware of the procedure to use the lambda expression to call the single arg constructor . But not sure how to invoke a constructor with additional arguments (not single arg). This can be achieved by using anonymous inner class as denoted in "How to call a specific parent constructor from anonymous inner class?" . But I am more interested in using the lambda expression.
For example: For calling the single arg constructor in Thread class, i can do this
Thread t1 = new Thread (() -> {
//do sometask
});
But I could not find a similar way to call the Thread(String name) constructor.
basically I want to do something like below using lambda
Thread t2 = new Thread("Thread2") {
@Override
public void run() {
}
};
Any help here is appreciated.Thanks.