Repository navigation
Expand file tree
/
Copy pathFabric.java
More file actions
51 lines (46 loc) · 1.48 KB
/
Copy pathFabric.java
File metadata and controls
51 lines (46 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package house;
public class Fabric{
/* Fields ************************************************************************/
private String color;
private String material;
private boolean machineWashable;
/* Constructors *****************************************************************/
public Fabric(String color, String material, boolean machineWashable){
this.color = color;
this. material = material;
this.machineWashable = machineWashable;
}
public Fabric(){
this("N/A", "N/A", true);
}
/* Getters *******************************************************************************/
public String getColor(){
return color;
}
public String getMaterial(){
return material;
}
public boolean getMachineWashable(){
return machineWashable;
}
/* Setters *******************************************************************************/
public void setColor(String color){
this.color = color;
}
public void setMaterial(String material){
this.material = material;
}
public void setMachineWashable(boolean machineWashable)
{
this.machineWashable = machineWashable;
}
/* Methods ********************************************************************/
public String printInfo(){
if(machineWashable){
return("The fabric color is: " + getColor() + " the material is: " + getMaterial() + " the fabric is machine washable");
}
else{
return("The fabric color is: " + getColor() + " the material is: " + getMaterial() + " the fabric is NOT machine washable");
}
}
}