You call the split method to divide the string in portions (words) separated by a space character, which will produce an array of strings. The number of elements in this array depends on the number...
String lname = details[1];
because you are assuming that details will have (at least) two elements. I guess you expect the string read from the scanner three...
I would just use a for loop, going from 0 to half the length of the string, using it as an offset from both ends of the string and compare the characters in those positions. You can stop when the...
In line 13 of the Grid class (where the exception is thrown) you are invoking the setValue method on an element of the playerBoard array, but the elements in this array are not initialised before...
If you are running your program in Windows you need to use cmd for the shell instead of ksh. You also need to pass /C as an option to cmd so it runs the command (ie your shell script) and terminates,...
You need to save the values in variables in the enum using an appropriate constructor. For instance, if you wanted to have an enum for the grades with their corresponding points you could do...
What I mean is that you have to review your code looking for the point (before invoking the method that throws the exception) where the instance used in the method would be assigned a reference (to...
Still not the code throwing the exception. Read the stack trace again; it says that the NullPointerException was thrown at line 932 of the class bcc.lib.Context, especifically when executing the...
That depends on what strings the st.nextToken() method is returning. If these strings can repeat, ArrayList will load them as different elements, but when you put these duplicates in the HashMap they...
You can use Scanner for that, but then you don't have to use String.split(). Instead of reading the whole input as one string and splitting it, just read and store the lines one by one. In this case...
Have you read the API docs on Scanner.nextLine() before using it? It usually helps to know how the methods you try to use work. If you had read the API docs you would have seen that nextLine "returns...
Another silly question: has anyone tested this new version before doing the update? If someone tested it, I can't believe they didn't find any of these many issues before...
Since the last update the response time of this site has been consistently bad. Not to the extreme of your experience, though a couple of times I closed the browser fed up with waiting for the page...
These "upgrades" are really bad. On one hand, I quite like the new graphics, but the new colour scheme is horrible (several other users have complained about this)...
I think it is possible (and quite easy) with a method with that signature. But I agree with you that there are better solutions without using recursion.