0

I am passing an object of class "String" to hello function and i want to pribt all the chars so i am using foreach loop

My main motive is to use foreach so please help me to type cast it

follwoing is the code i have

int i=0 ;
public void hello( String st)
{

for(int i:collection((String) st))
{
System.out.println(st.charAt(i));
i++;
}

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Ezzaral
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.