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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -