Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i'm beginner
what does this method do?

public String [] foo(String [] a)
{
String [] temp = new String[a.Length];
for(int i =0;i<a.length;i++)>
{
   temp[i]=a[i].toLowerCase();
}
 return temp; //function of this statement??
}

also,

public int foo(int [] a)
{
int temp=0;
for(int i=0;i<a.length;i++)>
{
 if(a[i]==5)
temp++;
return temp;
}
Posted
Updated 30-May-14 5:07am
v3

1 solution

What do you think it does?
It's not exactly complicated.

It returns an array of strings that is the same as the input, except the strings are all in lowercase: "Hello World!" becomes "hello world!" and so forth.

The second one is even easier, so I'll let you work that one out on your own: it's your homework, after all!
 
Share this answer
 
Comments
RDBurmon 30-May-14 11:20am    
:) +5
mhassan083 30-May-14 11:46am    
what do u mean ....can explain the second method?
mhassan083 30-May-14 11:46am    
in the second method temp is not array

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900