Re: Arrays
From: Andrew Harker (andrew_at_sadNOSPAMPLEASEgeeks.com)
Date: 07/13/04
- Next message: Roedy Green: "Re: GUI Programs"
- Previous message: Steve Horsley: "Re: GUI Programs"
- In reply to: Univ: "Re: Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 13 Jul 2004 18:39:57 +0100
> "Univ" <Dhanesh81@intnet.mu> wrote in message
> news:ccvan7$kvo$1@news.intnet.mu...
>
>>I've got the Following assignment to do and Im getting the following
>>problem,.
>>
>>1 Create a class called ArrayDemo , --- this is OK.
>>2 define a public static method called replaceArrayElement() that takes
>>names(a reference to an array Object of String) , index(*of type int) and
>
> a
>
>>value(aString object reference) as arguments
>> -- I did this -- public static replace
>>ArrayElement(String[] names , int index , String value) - is it OK?
>>
[snip]
Univ wrote:
> I've done this so far and am stuck at step5
>
> public class ArrayDemo
> {
> public static void replaceArrayElement()
> {
> String [] names;
> int index;
> String value;
> }
>
[snip]
Nope, it looks like you are stuck at step 2. Define this function as
specified (look at how you are using it later on or in your comments
above ... although there is no return value and you try and use one
later)
Why not try out your replaceArrayElement method before you try the next
steps by calling it and printing out the values again to make sure it
is working.
Fix this first then move on to step 5 where you can use this
static method to alter the array.
-- Andrew
- Next message: Roedy Green: "Re: GUI Programs"
- Previous message: Steve Horsley: "Re: GUI Programs"
- In reply to: Univ: "Re: Arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|