0
Hiw to solve this problem?
Private string name; (show error about illegal start of expression) ...
9 ответов
+ 1
private String name; // capital S , small p
Show the full code, if not work..
+ 1
lr oi
private, public, protected are keywords which should be in small letter
String is a class which should start from Capital letter because classes start from Capital letter
name is a variable which should follow camelCase rules means if there are more than two words in a variable then variable name should be camelCase
So here:
private String name;
+ 1
Manav Roy
You cannot use public, private, protected inside method. It should be inside class
+ 1
Manav Roy
Yes because variable inside method is not accessible outside the method means it is local to the method so doesn't make sense to use access modifiers.
0
Manav Roy
May you missing any braces or wrong syntax.
Only on seeing code, I can tell mistake if any. So only it's a guess now..