18 code example
Example: 18
public class Apartment { int numOfFloors; public int getFloors(){ return numOfFloors; } public void setFloors(int number){ numOfFloors = number; } public addFloors(int count){ numOfFloors += count; } public void main(String[] args){ Apartment a1 = new Apartment(); a1.setFloors(20); Apartment a2 = new Apartment(); a2.setFloors(18); Apartment a3 = a2; a3.addFloors(6); System.out.println(a1.getFloors()); } }