import Calendar.Day; class P07_ShortCircuit_DayChk { public static void main(String[] args) { Day day=null; int y,m,d; y=2014; m=13; d=31; if (Day.valid(y, m, d)) day= new Day(y,m,d); if (day.isEndOfAMonth()) System.out.println("end of month"); System.out.println("program stops here"); } } //if (day!=null&&day.isEndOfAMonth()) //avoid runtime error: java.lang.NullPointerException