While not strictly a Java solution, the HTTP header field called "referer" generally has a URI to the linking document. The W3C HTTP/1.1 Header Field Definitions (section 14.36) gives a brief overview.
Best regards!
User Profile
Collapse
-
First off, I'd get rid of this:
And replace it with this:Code:qnty = (stwqnty*1) + (corqnty*1);
Before the line parsing the quantity, use a quick regular expression:Code:qnty = stwqnty.parseInt() + corqnty.parseInt();
That just makes sure that the string is the characters 0-9 throughout.Code:if (!(stwqnty + corqnty).match ( /^[0-9]$/ )) { // Error message return; }
Best regards!...Leave a comment:
-
Well, to call a method in another class is quite simple:
It looks like the instructions at some point ask to create a Player class. Make it private and put it inside Game; add the fields:Code:OtherClass.method ( /*args*/ );
The constructor needs to set the name, that's it. It might be good to have a get and set method for...Code:private class Player { private String name; private int score; }Leave a comment:
-
It looks to me like you haven't initialized filePosition. Try setting it to 0 at the beginning of the method.Leave a comment:
No activity results to display
Show More
Leave a comment: