14. What is the output of the following program? class University protected void get Data () System, out .print]n("Inside University"); class U1TM extends University protected void getData() System. out. println("Inside U1TM") ) public class Test public statio void main (String[] args) University obj - now 01TM () ; obj. getData(); A. Inside University B. Inside UiTM C. Compilation Error D. Runtime Error class?

Computers

Question
14. What is the output of the following program?
class University
protected void
get Data ()
System, out .print]n("Inside University");
class U1TM extends University
protected void getData()
System. out. println("Inside U1TM")
)
public class Test
public statio void main (String[] args)
University obj - now 01TM () ;
obj. getData();
A. Inside University
B. Inside UiTM
C. Compilation Error
D. Runtime Error
class?
Answer

B. Inside UiTM

Download to view full explanation
The output of the program is "Inside UiTM" because the getData() method in the UiTM class overrides the getData()...
Solve any homework question FREE with our app, NO PAYMENT required!