You are viewing a single comment's thread. Return to all comments →
You say importing a library is not allowed but yet, you need to import
java.util.Calendar
and
java.util.Locale
at least :)
By the way, here is my solution (Java 7):
import java.util.*; public class Solution { public static String getDay(String day, String month, String year) { Calendar cal = Calendar.getInstance(); cal.set(Integer.valueOf(year), (Integer.valueOf(month) - 1), Integer.valueOf(day)); return cal.getDisplayName(Calendar.DAY_OF_WEEK,Calendar.LONG, Locale.getDefault()).toUpperCase(); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
You say importing a library is not allowed but yet, you need to import
and
at least :)
By the way, here is my solution (Java 7):