- World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.

Get it now !!
Send your Resume to 6000 Companies
Java Patterns Interview Questions & Answers - Learning Mode

Java Patterns Interview Questions & Answers - Learning Mode

Design Patterns are already defined and provides industry standard approach to solve a recurring problem, so it saves time if we sensibly use the design pattern. There are many java design patterns that we can use in our java based projects. Using design patterns promotes reusability that leads to more robust and highly maintainable code. It helps in reducing total cost of ownership (TCO) of the software product. Since design patterns are already defined, it makes our code easy to understand and debug. It leads to faster development and new members of team understand it easily.

Try Java Patterns Interview Questions & Answers - Exam Mode


Sort By : Latest First | Oldest First | By Rating

Java Patterns Interview Questions & Answers - Learning Mode
Try Java Patterns Interview Questions & Answers - Exam Mode
Question: What are the contexts in which Patterns can be used?

Answer: Java patterns are used in these scenarios they are: -
? Giving solutions to recurring problems.
? Practical solutions to real world problems rather than theoretical solutions.
? It can also be used to document real world solutions to a particular problem.
? It can work really well for given concern or trade offs. Source:
Question: Explain about closed subsystems?

Answer: In a closed system a developer will have a perfect knowledge about all the possible behaviors and static design time. By employing encapsulation techniques one can close parts of the system. This is possible in product level components and the lower rung of individual classes. Source:
Question: Describe some of the uses of patterns (Java)?

Answer: Java patterns are used for many purposes some of them are: -
1) It describes about the problem and its solution in detail.
2) Solving a common problem becomes easy because of predefined solutions from other programmers and developers.
3) They describe practical problems rather than theoretical problems they are very useful in the real world.
4) Time utilization and productivity is greater due to the usage of Java patterns. Source:
Question: Explain about abstract factory method?

Answer: Abstract factory pattern is used to create instances of abstract classes from a matched set of concrete sub classes. This pattern allows a developer to use various complex technologies such as windowing systems with similar characteristics and functionality. It basically creates abstract classes. Source:
Question: Explain about state dependence?

Answer: State dependence tells you about the action performed on the object whether succeeded or failed, action which can be performed, monitoring methods, postponing, triggering, preventing, etc. This is also used to monitor methods. Source:
Question: Explain about particle canvas?

Answer: Particle canvas is a sub class of java.awt. Canvas this class provides a drawing area for all the particles. Whenever a paint method is called it invokes draw for all the existing particles. It cannot create object or particles by itself. Existing particle objects are stored in the array of instance variable particles. Source:
Question: Explain the difference between Canonical and GoF form?

Answer: Canonical and GoF patterns are almost similar in characteristics. Canonical form places greater importance on explicit forces and resolutions whereas in GoF format a solution is broken into different sections and it also uses design diagrams with sample code. Source:
Question: State all the different patterns and give the various divisions present?

Answer: There are various different patterns and they can be divided into these patterns they are: -
1) Fundamental design patterns
2) Creational patterns
3) Partitioning patterns
4) Structural patterns
5) Behavioral patterns
6) Concurrency patterns
Delegation, Interface, Immutable, Proxy and marker interface are some of the sub divisions present in Fundamental interface. Source:
Question: Explain about Template method?

Answer: Template method is the most common way of representing. Implementation of a method differs for files, sockets, pipes, strings, text entry widgets, etc. When template method is used logic of the entire class is modified. Missing logic can be called by abstract and concrete methods. Source:
Question: State some of the elements present in Canonical pattern?

Answer: There are very few patterns which are used by developers and programmers they are Gang of four patterns, Canonical form or pattern and Alexandrian form. Some of the elements present in patterns are Problem, name, aliases, context, forces, solution, examples, resulting context, rationale, related patterns, uses, etc. Source:
Question: Explain about locks?

Answer: Lock is known to be the safest and the basic message control mechanism used in object oriented mechanism. This is used to block the usage of methods while another method is in progress. The only safest way to use lock mechanism is to fully synchronized objects. Source:
Question: Explain about open systems?

Answer: Open systems are used widely by developers than the closed systems because these are attainable and achievable. It can be accessed across several dimensions. Full static analysis is not possible because of their nature and structural evolution which varies according to time. Open systems may load classes dynamically, can employ call backs, resource sharing, etc. Source:
Question: State the purpose of why a Java singleton should be used?

Answer: Java singleton is used when a constructor and finalize methods are used only once during the lifetime of the application. If a class is referenced from within then it is garbage collected by the Java which can be retrieved if called again but the problem comes when the constructor or finalize methods are used only once. Source:
Question: Explain about semaphores?

Answer: They are mostly used as concurrency control constructs. They adhere and support Sync interface and conform to acquire release protocol. It adheres to a set of permits initialized in a constructor. A semaphore can also be described on the basis of a metaphor. Source:
Question: Explain about the concept of Generative in Patterns?

Answer: Patterns are used to detail about a problem and its solution but is should not be restricted at that point it should also include about the difficulty of the problem, solution addressing all the concerns, constraints of all sorts, etc. It should include everything which revolves around the Generative solution to a problem. Source:
Question: Explain about fully synchronized objects?

Answer: In a fully synchronized object all methods are synchronized. Encapsulation violations are generally neglected. Methods are finite which release locks. Even in the presence of exceptions state of the object is at the beginning and end of each method. Source:
Question: Explain and detail about Java patterns?

Answer: Patterns are very useful programming technique to a programmer. They tend to make solutions easier by creating a design pattern which can be used by a different developer other than the creator. They function as problem solving documentation. Solutions offered by Java Patterns are very practical rather than theoretical. Source:


India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.28125 Seconds