Feature/bael 5609 static method (#12370)
* BAEL-5609: init * BAEL-5609: update examples * BAEL-5609: refactor * BAEL-5609: delete car example
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.staticmethods;
|
||||
|
||||
public final class CustomStringUtils {
|
||||
|
||||
private CustomStringUtils() {}
|
||||
|
||||
public static boolean isEmpty(CharSequence cs) { return cs == null || cs.length() == 0; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.baeldung.staticmethods;
|
||||
|
||||
public class StaticCounter {
|
||||
|
||||
private static int counter = 0;
|
||||
|
||||
public static int incrementCounter() {
|
||||
return ++counter;
|
||||
}
|
||||
|
||||
public static int getCounterValue() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user