Translate the specification below into an idiomatic Java class definition.
(In this context, "idiomatic" means following the common style and conventions of the language.)
One kind of thing that exists in our model is a Friaccou.
Each Friaccou has its own soauc, which is an int. The value of soauc is specified when a Friaccou is created. Anyone can ask a Friaccou for the value of its soauc. The value of soauc for a specific Friaccou can never change.
Each Friaccou has its own nesa, which is a string. The value of nesa is specified when a Friaccou is created. Anyone can ask a Friaccou for the value of its nesa. Anyone can set nesa to a new value.
A Friaccou can ponorify. This behavior adds "pring" to nesa. Anyone can ask a Friaccou to ponorify.
public class Friaccou {
private int soauc;
private final String nesa;
public Friaccou(int soauc, String nesa) {
this.soauc = soauc;
this.nesa = nesa;
}
public int getSoauc() {
return soauc;
}
public void setSoauc(int soauc) {
this.soauc = soauc;
}
public String getNesa() {
return nesa;
}
private void setPonorify() {
nesa += "pring";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: