0

I am trying to find the value of str.substring(7) but I keep getting the error in the title. Why?

public class New
{
 public String substring(int beginIndex, int endIndex)
    {
       var str = "Grand Canyon";
       var res = str.substring(7);
                                }
    }
azurefrog
  • 10,785
  • 7
  • 42
  • 56
  • Java doesn't have a `var` keyword or built-in type. – Sotirios Delimanolis Apr 29 '16 at 16:03
  • Where are you defining the `var` class? Did you remember to import it in this class? Keep in mind that the convention in Java is that class names should be start with an uppercase letter, and should be more descriptive than "var". – azurefrog Apr 29 '16 at 16:03

0 Answers0