The Handling of null Values in Method Parameters


Some methods of the PersistenceManager interface take parameters of the following types:

  • Object

  • Object[]

  • Collection

When a null value is passed for a Collection or Object array parameter, the method throws a NullPointerException. When a null is passed as the value of an Object parameter, the method invocation is a no-operation (no-op) that returns silently and returns a null if it has a reference return type. When a null is passed as the value of one of the elements of an Object array or Collection parameter, then that element is ignored. The non-null values of the Object array or Collection parameter are processed normally.




Using and Understanding Java Data Objects
Using and Understanding Java Data Objects
ISBN: 1590590430
EAN: 2147483647
Year: 2005
Pages: 156
Authors: David Ezzio

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net