Type: Posts; User:
Java is a case sensitive language, so String is not the same as string (also notice it's System, not system).
The convention is to capitalise class names (Hello instead of hello), and use...
March 27th, 2013
March 12th, 2013
Or why not using the more suitable and standard ISO codes? (see ISO 3366 and ISO 4217)
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...
February 28th, 2013
The exception is thrown in this line:
String lname = details;
because you are assuming that details will have (at least) two elements. I guess you expect the string read from the scanner three...
February 22nd, 2013
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...
February 20th, 2013
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...
February 13th, 2013
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,...
February 7th, 2013
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...
January 3rd, 2013
keang posted the answer already (see post #8)
September 5th, 2012
No, this is the CodeGuru downgrade effect... just wait for the next upgrade, when everything is going to get worse (guaranteed).
I wouldn't have used worked in this context.
August 16th, 2012
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...
August 15th, 2012
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...
August 15th, 2012
Do you mean that the code you posted is not the code that's raising the exception? Why don't you post the actual code?
August 15th, 2012
Have a look at these two lines of your code:
if (getDisplayLifeReviewForHome( agt ).equals( TRUE ))
In the second of these lines you are invoking the...
August 12th, 2012
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...
August 11th, 2012
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...
August 10th, 2012
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...
I think that's the best option right now.
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...
After several weeks it...
It seems there is a + missing between number1 and "-".
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...
Nope, you are not the only one.
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.
@raylistic87, your attempt is not too far...
Click Here to Expand Forum to Full Width