dhust
1/19/2017 - 8:24 PM

Encapsulation non-example. There's no setter for the age & the age is public, so anyone can change it to anything they want, even invalid v

Encapsulation non-example. There's no setter for the age & the age is public, so anyone can change it to anything they want, even invalid values.

public class EncapsulationNonExample {
	
	// variables
	public int age;
	
	// default constructor
	public EncapsulationNonExample() {
		
	}
	
}