I’m doing the University of Helsinki Java MOOC and there’s an exercise that consists in creating a program that lets you input as much numbers as you want, but as soon as you input a 0 the program ends and prints the total number of inputs you did and the sum of all of them. I wrote the code and
Advertisement
Tag: break
Ordered or unordered Sequence problem in java
I am facing problem in solving the question below:- (can someone please help????) Write a program that reads a sequence of integer numbers and outputs true if the sequence is ordered (in ascending or descending order), otherwise, false. Keep in mind, if a number has the same value as the following number, it does not break the order. The sequence
How to break out or exit a method in Java?
The keyword break in Java can be used for breaking out of a loop or switch statement. Is there anything which can be used to break from a method?
Advertisement