Solved

Complete the Following Code Snippet, Assuming That Method FindEmployeeByID Takes

Question 2

Multiple Choice

Complete the following code snippet, assuming that method findEmployeeByID takes an employee id as input and returns a result of type Optional<Employee> and method displayEmployee takes an Employee object as input and displays the employee's information.
Optional<Employee> empSearch = findEmployeeByID("123456789") ;
if (empSearch.isPresent() )
{
_____________________________
}
else
{
System.out.println("Employee does not exist") ;
}


A) displayEmployee(get(empSearch) ;
B) displayEmployee(empSearch.get() ) ;
C) displayEmployee(empSearch) ;
D) displayEmployee(empSearch.of() ) ;

Correct Answer:

verifed

Verified

Related Questions