Question: Consider the fotowing classes defried in a Spring sppikaton package com.demo.company / public class Addres private String eity private String pincode public Address ( )

Consider the fotowing classes defried in a Spring sppikaton
package com.demo.company/ public class Addres
private String eity
private String pincode
public Address ()(//getter and setter methods)
package Lage com.demo.company/
public class Employee
private Address address: //getter and setter methods)
Config.xml
Main class:
ApplicationContext ace new ClassPathXmlApplicationContext("config.xml"):
Employee el (Employee) ac.getBean ("employee");
System.out.println("City: "+el.getAddress().getCity()+" Street: "tel.getAddress().getPincode()):
What is the output of the above code execution?
42
4
Throws NullPointerException
Display city as "Los Angles" and pincode as null
Display city and pincode as null
No bean named 'address' available
Display city as "Los Angles" and pincode as "91167"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!