Java 8 optional in detail

When writing programs in java, we often deal with scenarios where we get null reference for objects. Such scenarios are pain for developers, as de-referencing such variables cause, you guessed it, null pointer exceptions. The standard practice, for developers, before Java 8, was to null check every time you faced such ambiguous instances of objects.

Ascending Descending Order Java

Ascending order is the order in which the number starts from lowest and move to the greatest, whereas Descending order is the order in which the number start from the greatest and move toward the lowest. Check out the simple java code for ascending and descending of a give set of numbers. Ascending Descending Order