Java Guava | Shorts.join() method with Examples
Shorts.join() is a method of Shorts class in Guava library which returns a combined string of all the given short values separated by separator. For example, join(“-“, (short) 1, (short) 2, (short) 3) returns the string “1-2-3”.
public static String join(String separator, short... array)
- separator : The text that should appear between consecutive values in the resulting string (but not at the start or end).
- array : An array of short values, possibly empty.
Return Value: A string containing the supplied short values separated by separator.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.