2.9 to int would be "2". So if I wanted to used int for the double array, do I need to declare a new int inside the loop that can be used to index the array ? Thanks
Type: Posts; User: maple1100
2.9 to int would be "2". So if I wanted to used int for the double array, do I need to declare a new int inside the loop that can be used to index the array ? Thanks
Could you give me a hint on how to make the double work with for enhanced loop? Do I have to declare an "int" inside the loop and used that as the indexes or perhaps casting? I try both but none give...
Oh, I'm sorry. I though indexes of the array was referring to what is used to define the index of the array inside the for loop. For indexes to an array, they can only be int right?
I believes this is using the string as indexes right? Or I might be wrong.
String[] names = { "fred", "jane", "eric" };
for ( String name : names )
{
System.out.println( name );
}
Do the enhanced loop work with double? I get a loss of precision in the for loop at "double count". What can I change to make it work or do I just have to use for loop instead of enhanced? Thanks
...