I know it's not within the context of the question, but I wanted to write to find out if I'm wrong or not.
In the following code, it appears that the lambda expression is typed incorrectly, is this correct?
Code: Select all
public void invokeService(String srvname, String host, int port){
...
Socket socket = null;
try{
AccessController.doPrivileged( ( PrivilegedExceptionAction<Void> ) ()->
socket = new Socket(host, port);
return null;
}
...
}
And if this were not the case, if only the first line belongs to the lambda, which I do not think is the case, then the ; at the end of the expression it would not be bad.
Thanks in advance for responding