So the thing is I was checking Optional Java class and I noticed this in the public static<T> Optional<T> empty() doc:
@param <T> The type of the non-existent value*.
And, after looking at the whole class and searching over here and a few other pages I came to this questions that I haven't been able to answer:
- Can an empty
Optionalhave a specific type? 1.1 If so, how do you set it? 1.2 And is there any way to check its type?