import java.util.*;
class TimeTest
{
public static void main(String as[]) throws Exception
{
Date d=new Date();
int h=d.getHours();
if(h<12)
System.out.println("Good Morning");
else if(h<16)
System.out.println("Good Afternoon");
else if(h<20)
System.out.println("Good Evening");
else
System.out.println("Time to sleep, Good night");
}
}
0 comments:
Post a Comment