Shift + Enter · ప్రారంభించండి / పునఃప్రారంభించండి
కోడ్ ప్రాంప్ట్ గైడ్ని చదవండి
- ప్రోగ్రామింగ్ లాంగ్వేజ్
- Java
- కష్టం
- మధ్యస్థం
Create a class with a constructor and method.
public class Counter {
private int value;
public Counter(int start) {
value = start;
}
public int increment() {
value += 1;
return value;
}
}