Will you be able to have a job while attending the us naval academy?

Absolutely - the name of the job is called "U.S. Navy Midshipman".

While you're at the Academy, you're committed to your studies and duties on the grounds, and there's no time for any extra jobs. The Navy feels that if you've got time for an outside job, then that's time you can be spending working on being a better officer. You're at the Academy to learn how to be an officer and a professional sailor, not a flunkie at some job in town with a nametag.

It's not that much different in the regular fleet either. Only if you're on shore duty and are working a regular duty shift can you even consider taking a part time job, and even then you're required to report it, and it can't interfere with your duties.

Bottom line is that if you want to work a regular job, join the Reserves.