Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with assigning Array Size

 
Peter Kolozvary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What the heck is the problem?



The error I'm getting is Salaries.java:33: incompatible types
found : java.lang.Double
required: int
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EMPLOYEES is double type variable.. for declaring the array size.. you need to pass int data type.



now see this error again..

Salaries.java:33: incompatible types
found : java.lang.Double
required: int


hope it helps.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not Integer.parseInt()?
 
Peter Kolozvary
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I took a different route and have another question.

I need to Display the Names and Salaries of all Employees that are higher than the Average. I have included the code which shows how to display the highest salary of them all but am having trouble figuring out how to display this for each employee.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic