The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Re: Need to input algorithems with String values.

Originally Posted by Leonardo1143

Oh okay so using 10 for my example should fix it?

Not quite. You don't want to pass a String literal into the method, but rather the String variable that holds the number String. The String held by the variable should have no spaces, no letters, no punctuation, nothing but a number, and you should place the result of this method call into an int variable. Why not give it another try and see what happens?

As an aside, last I looked, your printf method call looked a bit off too.

Re: Need to input algorithems with String values.

Originally Posted by curmudgeon

I think one problem is that you may be confusing Strings with variables. For instance if you have a variable named armor, it is not the same thing as the String "armor", and you can't use them interchangeably. For instance if you have

String armor = "100";

You can't use "armor" in a method as a substitute for the variable above.

Re choice of 27, what example did you see it used in?

Edit:
Oh, I see. Yeah the Integer API does have an example of a 27 radix. This is very esoteric stuff, and something you'll likely never use. I suggestion that you don't use this example, but instead I'd use the Integer.parseInt method that takes a single String as a parameter, the one that uses the default base-10 radix.

Okay, now i am bit confused. So I may just go the longer route and just individually label the parts I need for my algorithm to work (armor,combat level,etc). Thanks for trying though.