TextStyle values() method in Java with Examples Last Updated : 29 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The values() method of TextStyle enum is used to an array containing the constants of this enum type, in the order, they are declared. Syntax: public static TextStyle[] values() Parameters: This method accepts nothing. Return value: This method returns an array containing the constants of this enum type, in the order, they are declared. Below programs illustrate the TextStyle.values() method: Program 1: Java // Java program to demonstrate // TextStyle.values() method import java.time.format.TextStyle; public class GFG { public static void main(String[] args) { // get TextStyle TextStyle ts = TextStyle.valueOf("NARROW"); // apply values() TextStyle[] array = ts.values(); // print for (int i = 0; i < array.length; i++) System.out.println(array[i]); } } Output: FULL FULL_STANDALONE SHORT SHORT_STANDALONE NARROW NARROW_STANDALONE Program 2: Java // Java program to demonstrate // TextStyle.values() method import java.time.format.TextStyle; public class GFG { public static void main(String[] args) { // get TextStyle TextStyle ts = TextStyle.valueOf( "FULL_STANDALONE"); // apply values() TextStyle[] array = ts.values(); // print System.out.println( "TextStyle length:" + array.length); } } Output: TextStyle length:6 References: https://docs.oracle.com/javase/10/docs/api/java/time/format/TextStyle.html#values() Comment More infoAdvertise with us Next Article TextStyle values() method in Java with Examples A AmanSingh2210 Follow Improve Article Tags : Java Java-Functions java.time.format package Java-TextStyle Practice Tags : Java Similar Reads TextStyle valueOf() method in Java with Examples The valueOf() method of TextStyle enum is used to return the enum of this type TextStyle with the specified name. Syntax: public static TextStyle valueOf(String name) Parameters: This method accepts name as the parameter which is the name of the enum constant to be returned. Return value: This metho 1 min read SignStyle values() method in Java with Examples The values() method of SignStyle enum is used to an array containing the units of this SignStyle, in the order, they are declared. Syntax: public static SignStyle[] values() Parameters: This method accepts nothing. Return value: This method returns an array containing the constants of this enum type 1 min read TreeMap values() Method in Java with Examples In Java, the values() method of the TreeMap class is present inside java.util package which is used to create a collection out of the values of the map. It basically returns a Collection view of the values in the TreeMap. --> java.util package --> TreeMap class --> values() Method Syntax: T 2 min read SortedMap values() method in Java with Examples The values() method of SortedMap interface in Java is used to create a collection out of the values of the map. It basically returns a Collection view of the values in the Map. Syntax: SortedMap.values() Parameters: The method does not accept any parameters. Return Value: The method is used to retur 2 min read Map Values() Method in Java With Examples Map Values() method returns the Collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. Syntax: map.values() Parameter: This method does not take any parameter. Return value: It returns a collect 2 min read Provider values() method in Java with Examples The values() method of java.security.Provider class is used to return an unmodifiable Collection view of the property values contained in this provider.Syntax: public Collection<Object> values() Return Value: This method returns a collection view of the values contained in this map.Below are t 3 min read ValueRange toString() method in Java with Examples The toString() method of ValueRange class is used to return this ValueRange as a String in format '{min}/{largestMin} - {smallestMax}/{max}', where the largestMin or smallestMax sections may be omitted, together with associated slash, if they are the same as the min or max. Syntax: public String toS 1 min read Byte shortValue() method in Java with examples The shortValue() method of Byte class is a built in method in Java which is used to return the value of this Byte object as short. Syntax ByteObject.shortValue() Return Value: It returns the value of ByteObject as short. Below is the implementation of shortValue() method in Java: Example 1: Java // 2 min read Number.shortValue() method in java with examples The shortValue() is an inbuilt method in Java from the java.lang.Number class. This method is used to convert the current number object into a short primitive type. This may involve rounding or truncation because the short data type in Java is a 16-bit signed integer with a value range from -32,768 2 min read ValueRange of() method in Java with Examples The of() method of ValueRange class helps us to Obtains value range based on parameters passed to it. There are three types of of() methods based on parameters passed to it. of(long min, long max): This method help us to get a fixed value range where the minimum and maximum values are fixed. Syntax: 3 min read Like