1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

OOPs and Design Pattern interview questions

  • What is Observer pattern ? Explain with Code Example ? view answer
  • "is-a" relationship describes inheritance relationship between objects view answer
  • has-a relationship, which is also called object composition view answer
  • The four main concepts are involved in OOP view answer
  • Example Java Code For Association & Aggregation & Composition view answer
  • What are the common things need to consider while Creating and Destroying Objects view answer
  • what is the difference between encapsulation and data hiding? explain with Code example? view answer
  • Dependency In Java view answer
  • Is Singleton class is serialized ? view answer
  • What is Singleton ? and Double-checked locking ? view answer
  • What is Factory Method pattern? view answer
  • What is Adapter pattern ? view answer
  • What is Proxy and Decorator patterns ? With Java Example ? view answer
  • Brief Introduction to OOP Concepts view answer
  • What is Abstract Factory Pattern ? With Code Example ? view answer

!!! OOPs and Design Pattern interview questions !!!

What is Proxy and Decorator patterns ? With Java Example ?



A Proxy is a direct stand-in for another class, and it typically has the same interface as that
class because it implements a common interface or an abstract class. The client object is not
aware that it is using a proxy. A Proxy is used when access to the class the client would like
to use must be mediated in a way that is apparent to the client -- because it requires
restricted access or is a remote process, for example.
Decorator, like Proxy, is also a stand-in for another class, and it also has the same interface
as that class, usually because it is a subclass. The intent is different, however. The purpose
of the Decorator pattern is to extend the functionality of the original class in a way that is
transparent to the client class.
Examples of the Decorator pattern in the Java API are found in the classes for processing
input and output streams. BufferedReader(), for example, makes reading text from a file
convenient and efficient:
BufferedReader in = new BufferedReader(new FileReader("file.txt"));



Reviews and Comments


PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2016


About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy