Which line of code shows how to display a nullable string's length and shows 0 instead of null?

Question:Which line of code shows how to display a nullable string's length and shows 0 instead of null?

1.Println(b!!.length ?: 0)

2.Println(b?.length ?: 0)

3.Println(b?.length ?? 0)

4.Println(b == null? 0: b.length)


Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!