0
We can use the enum instead of int,char,float this type of declaration please help mee
Your program prints New A New B Why? Because in main function you are declaring object of class B which is child class of class A Complier see that you create object of class b but class b is extended to class A instead of going inside of class B it goes to it's parent class because it see class B extends class A {} Then it's prints new A from class A And then prints new B from class B after compiling class A .
2 Respuestas
+ 3
Can you post the code as well?
+ 2
Please specify the language in Relevant Tags. 'mounika' doesn't help in deducting the scope of your question 👍