Structural and Behavioural Patterns

1. Which of the following is not an example of a Structural pattern?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

2. Suppose you are developing a large-scale software application that needs to work with a complex database schema. You want to create a structural pattern to separate the database access logic from the application logic.Which of the following statements about using the DAO (Data Access Object) design pattern to accomplish this goal is true?
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

3. What will be the output of this code? class Parent { static void show() { System.out.println('Parent'); } } class Child extends Parent { static void show() { System.out.println('Child'); } } public class Main { public static void main(String[] args) { Parent p = new Child(); p.show(); } }
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

4. What will be the output of the following code? class A { void display() { System.out.println('Class A'); } } class B extends A { void display() { System.out.println('Class B'); } public class Main { public static void main(String[] args) { A obj = new B(); obj.display(); } }
Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation

Explanation