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; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Field; | |
public class ObjectFactory { | |
public static <T> T create(Class<T> clazz) throws Exception { | |
T instance = clazz.newInstance(); | |
processAnnotations(instance); | |
return instance; |
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) { |
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; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class ProxyFactory { |
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 com.lq; | |
public enum CreditCardType { | |
VISA("111-22-3333") { | |
@Override | |
public boolean isValid() { | |
System.out.println("Validating a " + this.name()); | |
return false; | |
} |
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 com.lq; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Date; | |
import java.util.Iterator; | |
public class GenericsExample { | |
public static void main(String[] args) { |
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 com.lq; | |
public class InnerClassExample { | |
public static void main(String[] args) { | |
Driver d = new Driver(); | |
Car c = new Car(); | |
d.operate(c); | |
d.operate( | |
// anonymous Inner class | |
new Driveable(){ |
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
-startup | |
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar | |
--launcher.library | |
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222 | |
-showsplash | |
org.eclipse.platform | |
--launcher.XXMaxPermSize | |
512m | |
--launcher.defaultAction | |
openFile |
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
https://anonsvn.springframework.org/svn/spring-samples | |
https://github.com/SpringSource |
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 class Test { | |
public static void main(String[] args) { | |
} | |
} |
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
import java.io.BufferedReader; | |
import java.io.FileWriter; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; |