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 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.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; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Info(authors = @Author(fn = "Karan", ln = "Malhi"), version = 1.1) | |
public class Person { | |
@Info(authors = { @Author(fn = "Karan", ln = "Malhi"), |
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 Rectangle { | |
private final Size size; | |
public Rectangle(Size size) { | |
this.size = size; | |
} | |
public Size getSize() { |
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.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.Set; | |
public class BoxTest { |
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.util.ArrayList; | |
import java.util.Iterator; | |
public class TestGenerics { | |
public static void main(String[] args) { | |
ArrayList<Number> list = new ArrayList<Number>(); | |
list.add(new Integer(0)); | |
list.add(new Integer(1)); | |
list.add(new Integer(3)); |
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.File; | |
import java.io.IOException; | |
import java.util.Enumeration; | |
import java.util.concurrent.ConcurrentLinkedQueue; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.TimeUnit; | |
import java.util.zip.ZipEntry; | |
import java.util.zip.ZipException; |
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.learnquest; | |
import java.lang.reflect.InvocationHandler; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Proxy; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.logging.Logger; | |
public class ProxyTest { |
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.interfaceimpl; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Qualifier | |
public @interface Criteria { |