Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Lourdes Edwards   on Jun 15 In Java Category.

  
Question Answered By: Wilbur Hall   on Jun 15

First you need something to read input from. I always use a
BefferedReader. You need to import the java.io package and then dot
he following to read a String:

BufferedReader in = new BufferdReader(new
InputStreamReader(System.in));
String s = in.readLine();

To get an int from a String:

int i = Integer.parseInt(s);

Hope this help. Sorry, but I didn't have time to redo your code. Just
integrate the above into your application.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Need help with this code Or get search suggestion and latest updates.


Tagged: