79282971

Date: 2024-12-15 19:02:23
Score: 1
Natty:
Report link

U can use this:

String[] strings = createNew(100); // = new String[100];

or

Bars[] bars=createNew(10);// = new Bars[10];


@NonNull
public static <T> T[] createNew(int capacity, @NonNull T... array) {
    return java.util.Arrays.copyOf(array, capacity);
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Michael Puzio