SCJP
Visit my download page
add(BigInteger val)
Returns a BigInteger whose value is (this + val).
Joanne
SCJP
Visit my download page
Randall Twede wrote:i am kind of surprised the compiler let me get away with
number.add(BigInteger.ONE);
you would think it would say not an expression or something.
Randall Twede wrote:
Jeff Verdegan wrote:Still returning String I see. Ick.
SCJP
Visit my download page
Matthew Brown wrote:
Jeff Verdegan wrote:Still returning String I see. Ick.
It's not a bad idea in this context. All answers are intended to be typed into a web page - i.e. they will be treated as strings. It's probably the best choice if you want to have a consistent interface to your solutions.
SCJP
Visit my download page
Randall Twede wrote:not only that, but the main class displays the answers in a JTextArea. from there i just copy and paste the answer to the website. solve() really doesn't care what the main class does with it, it just knows it is supposed to return a String
~Bill
Jeff Verdegan wrote:I've been over this with RT before. The solve() method shouldn't know or care about the web page. There's no good reason for it to return String. From what I've seen so far, Number looks like the best candidate, but there are other options.
Matthew Brown wrote:
Jeff Verdegan wrote:I've been over this with RT before. The solve() method shouldn't know or care about the web page. There's no good reason for it to return String. From what I've seen so far, Number looks like the best candidate, but there are other options.
No, but it should care about the meaning of the answer.
Which will be used in one context and one context only: a string comparison
the formatting is part of the Euler problem,
Jeff Verdegan wrote:
Which will be used in one context and one context only: a string comparison
Which has nothing to do with the above.
Jeff Verdegan wrote:
the formatting is part of the Euler problem,
This is news to me, but the formatting is still a separate concern from solving the problem.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |