What\'s wrong with the below Code
public static void main(String[] args){
public static final String Name = \"Robin Wilson\";
}
as you are Declaring the String variable as public static final String Name = "Robin Wilson";
According to java rules, This String name is Local variable as you are declaring it in Main method. So only final is permitted here. you can define it as ** final String name="Robin Wilson";** in main method. for Local variables only final is permitted.
you can not use public static modifier for a local variable. Do any of the followings
public static void main(String[] args){
final String Name = "Robin Wilson";
}
or declare it as a member variable
public static final String Name = "Robin Wilson";
public static void main(String[] args){
}
Remember that the final is the only modifer of the local variables