Question: int decimalPointOffset = stringNumber.indexOf(.); // get offset (base 0) of decimal point in this String? if (decimalPointOffset < 0) // (no decimal point anywhere) {
int decimalPointOffset = stringNumber.indexOf("."); // get offset (base 0) of decimal point in this String? if (decimalPointOffset < 0) // (no decimal point anywhere) { System.out.println("Entered number must contain a decimal point."); continue; // go to top of loop to start over } We have not declared "stringNumber" and even when I declare it as a string it asks to be initialized. When I assign a value null, the program gives an error. What's a solution for this? JAVA LANGUAGE
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
