You should write getters and setters. Or better - let your IDE generate them automatically. Otherwise you break the encapsulation. Also maybe you need just a getter.
Another advantage of using a getter or setter can be doing some checks or preprocessing before returning or setting the field.
Here is a sample code snippet:
private String name;
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
Optionally you can use http://projectlombok.org/ and write it like this using annotations:
@Getter @Setter
private String name;
The code generation is done compile time.