Java Calendar getActualMinimum() Method3 Nov 2024 | 2 min read The getActualMinimum() method of java.util.Calendar class returns an integer value which is the Minimum possible value of the calendar field passed as parameter to getActualMinimum() methot. For example Minimum value for DATE field is 1 and similarly Minimum value for MONTH field is 0 . SyntaxParameterfield - the field of calendar like MONTH, HOUR , DAY_OF_MONTH etc. ReturnsReturns an integer value which is maximum value of field passed as parameter. ThrowsDoesn't throw any exception. Example 1Output: Minimum year value:1 Minimum Month value:0 Minimum Day value:1 Example 2Output: Minimum HOUR value is:0 Minimum Minute value is:0 Minimum Second value is:0 Example 3Output: Minimum value for DAY_OF_WEEK_IN_MONTH is :1 Minimum value for DAY_OF_MONTH is :1 Minimum value for DATE is :1 |
The getMinimalDaysInFirstWeek() method returns required minimum days in integer form. The minimal days required in the first week of the year is passed into this method. Syntax public int getMinimalDaysInFirstWeek() Parameter No parameter is passed. Returns Returns an integer value which is minimum days required in first week. Throws Does not throw...
2 min read
The hashCode() method of java is method of object class and object class is ultimate super class of all classes in java. hashCode() method is overloaded by all other classes in java. This method returns hash code for calendar object. Syntax public int hashCode() Parameter No parameter is passed. Returns A hash...
2 min read
The isLenient() method of Calendar class returns the Boolean value true if the interpretation mode of this calendar is lenient; false otherwise. Syntax Public boolean isLenient() Parameter No parameter is passed. Returns Returns Boolean value. Throws Does not throw Exception. Example 1 import java.util.*; public class JavaCalendarisLenintExample1 { public static void main(String[] args) { ...
2 min read
The getWeeksInWeekYear() method of java.util.Calendar class returns the total number of weeks in a week year in the integer form. Syntax public int getWeeksInWeekYear() Parameter No parameter is passed. Returns Returns the integer number of weeks in week year Throws UnsupportedOperationException: if any week number is not defined in the calendar. Example 1 import java.util.Calendar; public class...
1 min read
The SetFirstDayOfWeek() method of Calendar class is used to set the first day of the week. The value which is to be set as the first day of the week is passed as the parameter. Syntax public void setFirstDayOfWeek(int value) Parameter value - It is to be set as the...
3 min read
The setTime () method of java.util.Calendar class is used to set the Time of current calendar object. A Date object id is passed as the parameter into this method. Syntax public final void setTime(Date date) Parameter date - a date object. Returns Does not return value. Throws Does not throw Exception. Example 1 import java.util.*; public class...
2 min read
The getTimeZone() method of java.util.Calendar class gets the TimeZone of calendar object and returns a TimeZone object. Syntax public TimeZone getTimeZone() Parameter No parameter is passed. Returns Returns the TimeZone object. Throws Does not throw an exception. Example 1 import java.util.Calendar; import java.util.TimeZone; public class JavaCalendargetTimeZoneExample1 { public static void main(String[] args) { Calendar mycal = Calendar.getInstance(); ...
1 min read
The getActualMaximum() method of java.util.Calendar class returns an integer value which is the Maximum possible value of the calendar field passed as parameter to getActualMaximum() method. For example Maximum value for DATE field is 31, and similarly Maximum value for MONTH field is 11 . Syntax public int...
2 min read
The get() method of Calender class returns the value of the parameter fields passed into it. Fields like DAY_OF_MONTH, MONTH, YEAR, WEEK, WEEK_OF_YEAR etc are passed as parameter to this method. Syntax public int get(int field) Parameter Any field of calendar is passed as parameter. Returns Return value of passed field...
3 min read
The isSet() method of java.util.Calendar class is a final method which returns the Boolean value. This method checks whether the passed parameter value is set or not. If it is not set, it returns false otherwise true Syntax public final boolean isSet(int field) Parameter field - the calendar field. Returns Returns a...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India