I want to know how to add or append a new element to the end of an array. Is any simple way to add the element at the end? I know how to use a StringBuffer but I don\'t know
one-liner with streams
Stream.concat(Arrays.stream( array ), Stream.of( newElement )).toArray();