around this issue I am currently working with an array list of a movie rental store. I am trying to make a parameter of movieID,renterID, and movieName. I would like to make all of these one method when I run the program, so the user can input 1 or 2 or all 3 of these parameters. Is this possible to do this from one method/if so, how? Also, can I make it where java accepts a blank as a null instead of having the user type null? The specific code I am working with is below.
I hope this helps . From a pragmatic point of view, I would go with function overloading. But when thinking in pure Java terms, the one and only term is methods. Java does not know functions, only methods. Besides the interface Function.
How Can I get input from user until user enter the right input in java?
help you fix your problem In order to get the Base part of d, you need to cast to Base&. What you get with your cast is a temporary Base object, which can't be passed as a non-const reference argument.