André Vale André Vale - 1 year ago 106
Java Question

C# Nullable<T> equivalent in Java

Is there a C#

equivalent in Java?

If not, how should I define a field in a class that is able to assume a

Answer Source

Well any field of a reference type can be null. If you need something like a nullable int (int? in C#), then just use Integer (docs) in Java. Of course there are also types like that for double etc.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download