You will incur no additional obligation. If you plan on attending medical school, the Army offers medical scholarships to those who qualify. The scholarship pays for all school expenses and provides a salary while attending college. Scholarship students incur an additional service commitment equal to the time spent in medical school. The Army's Judge Adjutant General Corps also offers scholarships for law school.
Most officers wait to attend graduate school later in their career.
If accepted, the Army will pay for college and give you the time to finish your master's degree, while still receiving full pay and benefits. The Army then allows you to use your degree in a different functional area. One example is the foreign area officer program where upon completion of your graduate studies, the Army places you in a foreign country to work with the US ambassador.