you can write it simply: newValue = (myVariable == TRUE) ? 0 : -1; then you can do whatever you want with the newValue. if all you care to do is return it directly, just put the whole expression as the return value, like any other expression: return (myVariable == TRUE) ? 0 : -1; .
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...