Counting and Sorting word
I am trying to make a program without arrays that will sort an user inputed string of words in alphabetical order, and count the amount of words in a line
what i have so far, now im STUCK
public class p5dtn
{
private static String line, line2, hold, giver, end;
private static int first, second words;
public static void main (String[] args)
{
System.out.println("Enter a line containing words, then hit,Enter.");
words = scan.nextln();
}
do
while
private static String RemoveWord ( String Line, String Word )
{
Line = (" " + Line + " ");
Word = (" " + Word + " ");
first = Line.indexOf(Word);
second = first + Word.length();line2 = (Line.substring(0, i) + " ");
Line = (line2 + Line.substring(second));
return Line;
}
System.out.println("Line contains" count "words");
}

