• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's wrong with this line?

 
Anthony Smith
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int count = Integer.parseInt(data.getSession().getAttribute(username));

username is a String
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
username might be a String, but does data.getSession().getAttribute(String) return a String?
Good Luck,
-Dirk Schreckmann
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is username made up of all numbers. You are trying to parse a username into an int called count.
 
Junilu Lacar
Bartender
Pie
Posts: 7747
60
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he posted what he actually meant in this thread: http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=33&t=004853
Junilu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic