String de null kontrolü

C# ve Java gibi dillerde string genelde bir sınıf ile temsil edilir. Dolayısıyla null olma durumu mevcuttur. Null kontrolünü

if (name != null && name == "t-hex") {
...}

yazmak yerine kısaca

if ("t-hex".equals(name)) {
...}

yazmak daha bir afilli durur(muş).

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>