gudii9
asked on
fizzArray challenge
Hi,
I am working on below challenge
http://codingbat.com/prob/p180920
Psedo code description of approach :
1. identify size of array.
2. create new empty array of above size
3. keep putting each element of array with above values until size
I wrote my code as below
fizzArray is-->[I@15db9742
I am not seeing any test results when i ran above code
How to improve my design, approach, code? please advise
I am working on below challenge
http://codingbat.com/prob/p180920
Psedo code description of approach :
1. identify size of array.
2. create new empty array of above size
3. keep putting each element of array with above values until size
I wrote my code as below
public int[] fizzArray(int n) {
int size=n;
int[] ar=new int[size];
for(int i=0;i<n;i++){
ar[i]=i;
}
return ar;
}
public class FizzArrayEx {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("fizzArray is-->"+fizzArray(4).toString());
}
public static int[] fizzArray(int n) {
int size=n;
int[] ar=new int[size];
for(int i=0;i<n;i++){
ar[i]=i;
}
return ar;
}
}
i got below outputfizzArray is-->[I@15db9742
I am not seeing any test results when i ran above code
How to improve my design, approach, code? please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.