There's no difference between standard and stand-alone display text in a language like English, but some languages treat them differently. For example the display portion of 'day' extracted from a date object can be different than a stand-alone day which is not extracted from a date.
Using the default locale (US).
package com.logicbig.example.dayofweek;
import java.time.DayOfWeek;
import java.time.format.TextStyle;
import java.util.Locale;
public class GetDisplayNameExample {
public static void main (String[] args) {
DayOfWeek d = DayOfWeek.WEDNESDAY;
System.out.println(d.getDisplayName(TextStyle.FULL,
Locale.getDefault()));
System.out.println(d.getDisplayName(TextStyle.FULL_STANDALONE,
Locale.getDefault()));
System.out.println(d.getDisplayName(TextStyle.SHORT,
Locale.getDefault()));
System.out.println(d.getDisplayName(TextStyle.SHORT_STANDALONE,
Locale.getDefault()));
System.out.println(d.getDisplayName(TextStyle.NARROW,
Locale.getDefault()));
System.out.println(d.getDisplayName(TextStyle.NARROW_STANDALONE,
Locale.getDefault()));
}
}
Output
Wednesday
Wednesday
Wed
Wed
W
3
Using a different locale.
package com.logicbig.example.dayofweek;
import java.time.DayOfWeek;
import java.time.format.TextStyle;
import java.util.Locale;
public class GetDisplayNameExample2 {
public static void main (String[] args) {
DayOfWeek d = DayOfWeek.WEDNESDAY;
System.out.println(d.getDisplayName(TextStyle.FULL,
Locale.ITALY));
System.out.println(d.getDisplayName(TextStyle.FULL_STANDALONE,
Locale.ITALY));
System.out.println(d.getDisplayName(TextStyle.SHORT,
Locale.ITALY));
System.out.println(d.getDisplayName(TextStyle.SHORT_STANDALONE,
Locale.ITALY));
System.out.println(d.getDisplayName(TextStyle.NARROW,
Locale.ITALY));
System.out.println(d.getDisplayName(TextStyle.NARROW_STANDALONE,
Locale.ITALY));
}
}
Output
mercoledì
mercoledì
mer
mer
M
3