This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bounds.translateBy(10, 20) // 변경 가능한 Rectangle 객체 | |
bounds = bounds.translateBy(10, 20) // 값 스타일 Rectangle 객체 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract interface IFile { | |
public abstract void close(); | |
} |
NewerOlder