- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Display weekday names in Java
To display weekday names in Java, use the getWeekdays() method.
For that, firstly import the following package.
import java.text.DateFormatSymbols;
Now, create a string array and get all the weekday names using the getWeekdays() method.
String[] weekDays = new DateFormatSymbols().getWeekdays();
Example
import java.text.DateFormatSymbols; public class Demo { public static void main(String[] args) { String[] weekDays = new DateFormatSymbols().getWeekdays(); System.out.println("Weekday names..."); for(String days: weekDays){ System.out.println(days); } } }
Output
Weekday names... Sunday Monday Tuesday Wednesday Thursday Friday Saturday
- Related Articles
- Java Program to list Weekday names
- Java Program to list Short Weekday Names
- How can we display all module names in Java 9?
- C# Program to display temporary file names
- Python Pandas – Display all the column names in a DataFrame
- Display specific table names with MySQL LIKE Operator
- MySQL query to subtract date records with week day and display the weekday with records
- Display only the duplicate column names appearing atleast thrice in MySQL
- Display information about field names in MySQL including TYPE, KEY, etc.
- Weekday as a number in JavaScript?
- What is weekday() method in python?
- Format date to display month names with the entire date in MySQL?
- Calendar Functions in Python -(monthrange(), prcal(), weekday()?)
- How to display the column names from a table excluding some in MySQL?
- How do I write class names in Java?

Advertisements