How to get the name of the day in Java

1 Answer

0 votes
package javaapplication1;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Example {
    
    public static void main(String[] args) {
       
    	String nameOfTheDay = new SimpleDateFormat("EEEE").format(new Date());
        System.out.println(nameOfTheDay);
    }
}
   
   
/*
run:

Sunday
    
*/

 



answered Jan 24, 2016 by avibootz

Related questions

1 answer 278 views
1 answer 210 views
1 answer 202 views
1 answer 217 views
1 answer 199 views
...