10 Examples of Optional in Java 8 | Algorithm, Java programming language, Java
Skip to content
Search for easy dinners, fashion, etc.
When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures.
Null is bad, it can crash your program. Even its creator called it a billion-dollar mistake hence you should always try to avoid using nulls whenever you can. For example, you should not return a null String when you can return an empty String, similarly never return null collections when you can return an empty collection. I have shared many such tips in my earlier article, 10 tips to avoid NullPointerException and my reader liked that a lot. But, I wrote that article a couple of years ago… How To Use Java Optional, Java 7 Features List, Java Gc Algorithm Types, Java Sorting Algorithm, Insertion Sort Algorithm In Java, Java Algorithm Solution, Java Overriding Example, Evolutionary Algorithms In Java, Linked List Operations In Java
javarevisited.blogspot.com

10 Examples of Optional in Java 8

Null is bad, it can crash your program. Even its creator called it a billion-dollar mistake hence you should always try to avoid using nulls whenever you can. For example, you should not return a null String when you can return an empty String, similarly never return null collections when you can return an empty collection. I have shared many such tips in my earlier article, 10 tips to avoid NullPointerException and my reader liked that a lot. But, I wrote that article a couple of years ago…
javarevisited
Javin

Comments

More about this Pin

Board containing this Pin

Selected board cover image
Tech
50 Pins
7mo

Related interests

How To Use Java Optional
Java 7 Features List
Java Gc Algorithm Types
Java Sorting Algorithm
Insertion Sort Algorithm In Java
Java Algorithm Solution
Java Overriding Example
Evolutionary Algorithms In Java
Linked List Operations In Java