Question: I am a beginner with a weak understanding of Java. I use Dr.Java and I get this error:

```
     "S cannot be resolved"

```

With this Java program:

```
import java.util.Scanner;

public class HDtest5

{
    public static int countWords(String str) {
        String words[] = str.split(" ");
        int count = words.length;
        return count;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter a sentence: ");
        String sentence = in.nextLine();
        System.out.print("Your sentence has " + countWords(sentence) + " words.");
    }

    {
        while (true) // have created infinite loop
        {

            if (s.equals("quit"))
            // if enterd value is "quit" than it comes out of loop

            {

                String[] words = s.split(" "); // get the individual words
                System.out.println("#words = " + words.length);
                for (int i = 0; i < words.length; i++)
                    System.out.println(s + "word[" + i + words[i] + " nchars = " + words[i].length());

            }
            System.out.println(s); // to Print string
            System.out.println(s.length()); // to print Entered string's length

        }
    }
}

```

What causes this error message? 
I thought all the strings called 's' should work together without any problems. Could you please help me to find out what is wrong with it? Thank you very much for any help, its much appreciated!

Ps. Just to be more clear, the purpose of my program is to output total number of characters, characters of each word and a number of words of the text entered in text window (scanner). The code should work perfectly, except this 's' string problem which makes the chunks of code not work together.

Answer: 
If somebody is still looking for this solution, try not supplying controller and action names.

```
 @using (Html.BeginForm(null, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
    {
        @Html.AntiForgeryToken()

```
```
return RedirectToAction("Index", Request.QueryString.ToRouteValues());

```