Please correct from my code:


String[] choppedUpString = sentence.trim().split(" ");
String tempString="";
for (int i=0; i< choppedUpString.length ; i++)
for(int j=2; j<5; j++){
for (int k=i; k<j; k++)
tempString= tempString+" "+choppedUpString[k];
System.out.println(tempString);
}

I am unable to get the desired output.