3 Replies - 152 Views - Last Post: 29 July 2011 - 05:54 PM Rate Topic: -----

#1 nfm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-July 11

error in java program

Posted 29 July 2011 - 04:48 PM

I wrote this program for rock,paper,scissors and tried to compilt it but I keep getting this one error [int userPlay = Integer.parseInt.next() ;], that is underlined in red. so far i have erased the redline from everything except the parseInt. i've alt+entered it to see if i could find ot what they mean, gone back to the course manual and still have not found a solution for it. any suggestions?
Is This A Good Question/Topic? 0
  • +

Replies To: error in java program

#2 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2198
  • View blog
  • Posts: 5,226
  • Joined: 10-September 10

Re: error in java program

Posted 29 July 2011 - 05:06 PM

Are you using Eclipse? If so, do you get a hint of the error when you hover over the red lined portion (don't click anything)? If you're using another editor/IDE, there must be some simple way to determine why the code is underlined.

parseInt() is typically called as a method with arguments between the braces. Are you using it correctly?

If you can't figure it out, post the code
Was This Post Helpful? 0
  • +
  • -

#3 CasiOo  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1391
  • View blog
  • Posts: 3,077
  • Joined: 05-April 11

Re: error in java program

Posted 29 July 2011 - 05:07 PM

Integer.parseInt.next()

You mean
Integer.parseInt( String here );

?
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8328
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: error in java program

Posted 29 July 2011 - 05:54 PM

View Postnfm, on 29 July 2011 - 07:48 PM, said:

I wrote this program

Really ? You did write it ?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1