This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with assigning Array Size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with assigning Array Size" Watch "Help with assigning Array Size" New topic
Author

Help with assigning Array Size

Peter Kolozvary
Greenhorn

Joined: Sep 06, 2008
Posts: 6
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

Joined: Dec 06, 2005
Posts: 1321

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.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Why not Integer.parseInt()?


[Jess in Action][AskingGoodQuestions]
Peter Kolozvary
Greenhorn

Joined: Sep 06, 2008
Posts: 6
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.

 
jQuery in Action, 2nd edition
 
subject: Help with assigning Array Size
 
Similar Threads
counting slaries using query
NullPointerException
Input Validation Help
cannot understand the point of downcasting in the following code
Array vs Variable??