java - Error Expected int but given string -
i'm getting error. it's saying it's expecting int, i'm giving string. i'm not sure how fix this.
int dnastrandlength, stranddna; scanner dnainfo = new scanner (system.in); system.out.println ("please enter dna strand!"); stranddna = dnainfo.next(); dnastrandlength = stranddna.length();
you have declare stranddna string
.
int dnastrandlength; string stranddna; scanner dnainfo = new scanner (system.in); system.out.println ("please enter dna strand!"); stranddna = dnainfo.next(); dnastrandlength = stranddna.length();
if reading int have nextint() scanner.
Comments
Post a Comment