How can i fix this code that it will work ?
class Sample {
public int a;
private int b;
int c;
}
public class ex {
public static void main(String[] args) {
Sample aClass = new Sample();
aClass.a = 10;
aClass.b = 10;
aClass.c = 10;
}
}
The error i got:
The public type ex must be defined in its own file
The field Sample.b is not visible