java - Cannot find symbol when calculating whether weekend -
java - Cannot find symbol when calculating whether weekend -
i trying check whether given day weekend or not, receiving error saying
if (startdate.get(day_of_week) != calendar.saturday && (startdate.get(day_of_week) != calendar.sunday))
with pointer under sunday
not sure issue here is, sure have imported relevant classes necessary, fact startdate
in calendar
format. know issue here is?
import java.util.*; import java.text.*; import java.lang.*; //some code... if (startdate.get(day_of_week) != calendar.saturday && (startdate.get(day_of_week) != calendar.sunday))
if haven't imported constants in static
way, have access them via class name like
if (startdate.get(calendar.day_of_week) ... ^^^^^^^^^
everywhere utilize static fields.
java calendar
Comments
Post a Comment