This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Your numDays variable will contain the number of days since 1/1/1970, so it all depends on what day that was as to what value you will get by modding it by 7.
have you taken a look at the Calendar class. It has methods that will do this for you.