In the book, "Head First Java" (see Chapter 3), there is a section at the end of the chapter that tests the reader on various concepts. One is where you have to pretend to be the compiler and see if there are any errors in the proposed program and correct it...
The following is presented in the book:
This was my attempted correction:
The book (which I don't contend) gave this as the solution, however:
My question is if my proposed solution would also work. If not, what am I missing? I understand that in Java that there are multiple ways to do even the easiest and simplest of tasks as long as they obey the rules of Java...is my solution one of those ways?
THANKS!
The following is presented in the book:
This was my attempted correction:
The book (which I don't contend) gave this as the solution, however:
My question is if my proposed solution would also work. If not, what am I missing? I understand that in Java that there are multiple ways to do even the easiest and simplest of tasks as long as they obey the rules of Java...is my solution one of those ways?
THANKS!