I have an upper bound and a lower bound and I want to return all number number between the bounds including the bounds. I know python has a range function but I’m sure if java has this method.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can just use a for loop. Do you want to print them or return them? Your title and question disagree on this. If you want to return them, you will need to pick the type that you use to contain them.
I will leave it as an exercise to print them, or to get them in descending order.