Open DerekPeacock opened 3 years ago
Hi Derek,
I added the getChoice method at your request during the lesson yesterday. It doesn’t serve any purpose yet, because I fail to understand how it can be used.
One of my ideas was to pass a String choice through the method call along with the String[] menu we are looking at, and inside the method check I still have to break down the choice in the StockApp so I know what methods to call?
I left it that way as I needed advice to implement it.
I done the app05 in blueJ so it won’t be separated into folders unfortunately. I can manually create folders for class/java/txt files if you want me to.
Many thanks, Andrei From: Derek Peacock Sent: 21 November 2020 09:45 To: andreicruceru95/AndreiCruceru-BlueJ Cc: Subscribed Subject: [andreicruceru95/AndreiCruceru-BlueJ] App05 Menu (#7)
I can see an issue with trying to separate out Menus from the application class. Ideally the getChoice method should return the function that needs to be executed. I don't think java can return functions (method addresses) All the get choice can do is call on display choices, ask for the choice and if valid return it. If not valid re-display the choices and ask again — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I can see an issue with trying to separate out Menus from the application class. Ideally the getChoice method should return the function that needs to be executed. I don't think java can return functions (method addresses)
All the get choice can do is call on display choices, ask for the choice and if valid return it. If not valid re-display the choices and ask again