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 Besta.
All Bestas share a single avi, which is a string. No other classes can directly ask for the value of avi. The value of avi starts out as "ste" when the program starts. Every time a new Besta is created, it adds "ce" to avi.
public class Besta {
public static String avi;
public Besta() {
avi += "ce";
}
public static void onStart() {
avi = "ste";
}
}
Things to check in your solution:
public and private modifier correct?static?final?Acceptable variations in the solution:
+= 1 instead of ++.Related puzzles: