Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Database Technology Edbt 88 International Conference On Extending Database Technology Venice Italy March 14 18 1988 Proceedings Lncs 303

Authors: Joachim W. Schmidt ,Stefano Ceri ,Michele Missikoff

1988th Edition

3540190740, 978-3540190745

More Books

Students also viewed these Databases questions