« All Events
10 AM – Intro To Java
July 10, 2021 @ 10:00 am - 11:00 am
Today We Do
- We learn more about methods in Java: with and without return value.
- We learn about static and non-static methods.
Homework
- Copy the codes of main() from May22_IFELSEScanner.java into July10_TellMeYourAgeUsing.java . Just copy up to the end of the if else statement (“You are a senior”) . Run it and make sure it is running properly.
- Create applicationLoop() method.
- Copy all the code from main() into run() method.
- And call the run() from main() and make sure everything is still working. Look at how we did it in the July10_Magic8Ball_Methods_V3.java.
- Create a new method, getUserAge(). This method will return an Integer age.
- You will move the code that is responsible of asking user’s age from shell from applicationLoop() into getUserAge(). After this call getUserAge() from applicationLoop(). This is very similar in July10_Magic8Ball_Methods_V3.java where we call getUserQuestion() from applicationLoop()