Re: writing code for an array
"Keith Teo" <firstname.lastname@example.org> wrote:
>"angel" <email@example.com> wrote:
>>with an array called "fraction" of type float, what would be the code needed
>>to assign the value 1.667 to array element9 and the value to array3.333
>>array element 7.
>Assuming you have an array named fraction of type float, so..
>And that you have a total of 9 elements in your array, so..
>fraction= new float;
>Remember, float also counts as a element, java array starts indexing
>so to assign 1.667 to element 9.. u do this..
>and to assign 3.333 to element 7.. u do this..
>so code fragment is actually as follows..
>float fraction=new float;
>nbls reply to my email if you need clarifications.
thanks so much for the help.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL