public class StringExperiment extends Object
Constructor and Description |
---|
StringExperiment() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Tests the two versions of the 'repeat' algorithm, doubling the
size of n each trial, beginning with the given start value.
|
static String |
repeat1(char c,
int n)
Uses repeated concatenation to compose a String with n copies of character c.
|
static String |
repeat2(char c,
int n)
Uses StringBuilder to compose a String with n copies of character c.
|
public static String repeat1(char c, int n)
public static String repeat2(char c, int n)
public static void main(String[] args)