Skip to content

Instantly share code, notes, and snippets.

View libliboom's full-sized avatar
🎯
Focusing

Eric Lee libliboom

🎯
Focusing
View GitHub Profile
private String name;
public void runTest() throws Exception {
Class[] noArguments = new Class[0];
Method method = getClass().getMethod(name, noArguments);
method.invoke(this, new Object[0]);
}
public String substring(int beginIndex) {
if (beginIndex < 0) {
throw new StringIndexOutOfBoundsException(beginIndex);
}
int subLen = value.length - beginIndex;
if (subLen < 0) {
throw new StringIndexOutOfBoundsException(subLen);
}
return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
}
bounds.translateBy(10, 20) // 변경 가능한 Rectangle 객체
bounds = bounds.translateBy(10, 20) // 값 스타일 Rectangle 객체
class Transaction {
private int value;
/*package*/ Transaction(int value, Account credit, Account debit) {
this.value = value;
credit.addCredit(this);
debit.addDebit(this);
}
/*package*/ int getValue() {
public MapRecipe(Map<?, ?> map) {
if (map == null) throw new NullPointerException("map is null");
entries = new ArrayList<Object[]>(map.size());
if (RecipeHelper.hasDefaultConstructor(map.getClass())) {
this.typeClass = map.getClass();
} else if (map instanceof SortedMap) {
this.typeClass = TreeMap.class;
} else if (map instanceof ConcurrentMap) {
this.typeClass = ConcurrentHashMap.class;
} else {
public abstract interface IFile {
public abstract void close();
}