Closed itstrueitstrueitsrealitsreal closed 6 months ago
I think it might make sense in other weakly typed languages. However since Java is strongly typed, if you try to pass a null
into a function expecting an int
it won't even compile. So I don't think it's something we need to be concerned about in this case.
I think it might make sense in other weakly typed languages. However since Java is strongly typed, if you try to pass a
null
into a function expecting anint
it won't even compile. So I don't think it's something we need to be concerned about in this case.
To add on, this is because int
is a primitive type. If we use Integer
instead, then yes I think null
should be an equivalence partition.
Thanks for the input guys! Closing this issue.
Hi, wanted to clarify the following:
Let's take an example of a method,
foo(int i)
. Examples of equivalence partitions, depending on the context of the method, would be [MIN_INT, -1], [0], [1, MAX_INT].Would
null
be part of another EP? And would inputs from other types form other EPs as well? Or would they be part of the same EP?