So, whats wrong with the following start to a constructor of a Graph class?
public Graph(String fileName) {
File file = null;
try {
file = new File(fileName);
} catch (Exception e) {
// TODO: handle exception
}
public final class Groupify { | |
public static String groupify(final String input, final int groupSize) { | |
if (groupSize < 1) { | |
throw new IllegalArgumentException("groupSize must be bigger than zero, was " + groupSize); | |
} | |
final String inputPadded = input + "x".repeat((groupSize - input.length() % groupSize) % groupSize); | |
final String[] split = inputPadded.split("(?<=\\G.{" + groupSize + "})"); |
public final class Caesar { | |
private static final int NUM_LETTERS = 26; | |
public static String caesar(final String s, final int shift) { | |
return s.chars() | |
.filter(Caesar::isEnglishLetter) | |
.map(character -> getIntUnaryOperator((char) character, shift)) | |
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append) | |
.toString(); | |
} |
So, whats wrong with the following start to a constructor of a Graph class?
public Graph(String fileName) {
File file = null;
try {
file = new File(fileName);
} catch (Exception e) {
// TODO: handle exception
}