Created
June 14, 2011 18:58
-
-
Save karanmalhi/1025591 to your computer and use it in GitHub Desktop.
Basic interface and its impl
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
package learnquest; | |
public interface Reversable<T> { | |
T reverse(T str); | |
} | |
class StringReverser implements Reversable<String> { | |
@Override | |
public String reverse(String str) { | |
StringBuffer buf = new StringBuffer(str); | |
buf.reverse(); | |
return buf.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment