You are learning quickly. Yes it does. Only you have been given it spelt wrongly. It should read:-int I = (new Integer(string)).parseInt();
mean something like converting a string to int?
No, they don't. What you wrote first is the old way of reading a String [stated simply a String is writing of any length from completely blank to the text of "War and Peace," or longer.] This way of reading from the keyboard is awkward to set up, but still works.the codes in my books don't match.
It is suprising in Java how much you can do with a single line. The Integer.parseInt() method occupies about 3/4 of a page, and it uses another method, but you can use the whole lot for one line.just wondering since the code for reading a string is so short
No, they don't. You will find in everything in computing there are several ways to do it. Often severla "right" ways, and just as frequently, some "wrong" ways.the codes in my books don't match
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |