Russel Winder
2014-12-02 17:03:49 UTC
I find that:
a = []
a[2]
does not throw IndexOutOfBoundsException and returns null, but:
a = []
a.get(2)
throws IndexOutOfBoundsException. For me this is a failure of The
Principle of Least Surprise. Am I just missing something such that the
behaviour is acceptable and desired?
a = []
a[2]
does not throw IndexOutOfBoundsException and returns null, but:
a = []
a.get(2)
throws IndexOutOfBoundsException. For me this is a failure of The
Principle of Least Surprise. Am I just missing something such that the
behaviour is acceptable and desired?
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:***@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: ***@winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:***@ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: ***@winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder