java - Convert String to double -
i working on assignment in have been given task of creating arraylist of books. in utility, have 3 arg constructor (string title, string author, double price). in main, read contents of comma seperated value file (which contains list of book titles, authors, , price on seperate lines). tokenize contents of file (which able do), , instantiate arraylist holds book objects only. each book in text file, read record, tokenize record, , create new book object tokenized field, , add object beginning of arrraylist. question is:
when tokenize file (using string method split, assignment dictates), end line line break down of file (as should). think want feed these values constructor, constructor accepts args string, string, double, , of course tokenized file string, string, string. is there way 'convert' (for lack of better term) last string value double (i know doubles primitive , strings not), thought ask guys before go drawing board , figure out correct way of doing this. time.
call double.parsedouble()
here javadoc
Comments
Post a Comment