а какая разница?

Date: 2013-12-11 07:46 am (UTC)
From: [identity profile] serge shikov
В java нету non-nullable типов. А у null нельзя вызвать equals. В смысле, есть конечно примитивы, но строки к ним не относятся.

В конечном счете все сводится к:
"".equals(null)
vs
null.equals("")

Первое корректно говорит, что не равно, второе падает. Выглядит может и странно, но работает надежно, и читается теми кто в теме тоже нормально.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
222324252627 28
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 30th, 2025 03:24 pm
Powered by Dreamwidth Studios