fork(17) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. import java.time.*;
  8. import java.time.temporal.*;
  9. import java.time.format.*;
  10.  
  11. /* Name of the class has to be "Main" only if the class is public. */
  12. class Ideone
  13. {
  14. public static void main (String[] args) throws java.lang.Exception
  15. {
  16.  
  17. String output =
  18. LocalDate.parse( // Generate `LocalDate` object from String input.
  19. "23/2/2010" ,
  20. DateTimeFormatter.ofPattern( "d/M/uuuu" )
  21. )
  22. .getDayOfWeek() // Get `DayOfWeek` enum object.
  23. .getDisplayName( // Localize. Generate a String to represent this day-of-week.
  24. TextStyle.SHORT_STANDALONE , // How long or abbreviated. Some languages have an alternate spelling for "standalone" use (not so in English).
  25. Locale.US // Or Locale.CANADA_FRENCH and such. Specify a `Locale` to determine (1) human language for translation, and (2) cultural norms for abbreviation, punctuation, etc.
  26. ) ;
  27.  
  28. System.out.println( "output: " + output ) ;
  29.  
  30. // NOTE: This IdeOne.com site’s JVM overrides any specified `Locale` with `Locale.US`.
  31.  
  32. }
  33. }
Success #stdin #stdout 0.16s 4386816KB
stdin
Standard input is empty
stdout
output: Tue