Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. Optional is to be used for arguments / atrributes which are indeed optional i.e the request should continue even if they aren't provided. It should not be used for mandatory attributes or arguments as we would like application to shout out ( with error message / exception trace ) to signify a problem. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  optional  nullpointerexception  java8  java 8 Asked in 1 Companies | ||||
Related Questions | ||||
What is the use of Optional ? | ||||
Name few "Optional" classes introduced with Java 8 ? | ||||
How can we make the constructor variables optional in Typescript ? | ||||