Why is Math::max acceptable while it's apparently not a Comparator
It relies on a concept which is informally known as "single abstract method (SAM)" interfaces. The basic idea is that any interface with one abstract method can be automatically implemented by any lambda or method reference, if the lambda or method reference matches the SAM in the interface.go to through the following for more detail: http://www.programcreek.com/2014/01/why-stream-maxintegermax-compile/
DataStream classes such as DataInputStream and DataOutputStream class. why DataStream classes needed for input data. while we have others stream classes in java through which we can input the data.