using recursive Java method
import java.util.ArrayList;
public class Count
{
private String word;
public Count(String w)
{
word = w;
}
public ArrayList<String> getUpper()
{
ArrayList<String> result = new ArrayList<String>();
if(word.length()==0)
{
result.add(word);
return result;
}
for(int i=0;i< word.length();i++)
{
if(Character.isUpperCase(word.charAt(i)))
{
String shorter = word.substring(i);
Count shorterCount = new Count(shorter);
ArrayList<String> shorterCounter = shorterCount.getUpper();
for(String s: shorterCounter)
{
result.add(s);
}
}
}
return result;
}
}
Can someone give me some idea.
thanks very much