Abstraction, implementation hiding | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Abstraction, implementation hiding

Abstract Class a{ abstract void test();} B extend a{ void test(){ system.out.println(ā€œhelloā€);}} // in main class below B c= new B(); C. Test;//directly calling test method in child class Since all implementation in child class, what implementation is hiding here. Itā€™s bit confusing any one please help me on this. Thanks in advance

9th Jan 2018, 1:34 AM
Harsha Vijayakumar
Harsha Vijayakumar - avatar
1 Resposta
+ 2
You use b object known as c for calling test method in a abstraction class if there is an hiding it must be this: You dont use a for calling you just inherit a to b and call b so you hide a class but you use a classes method test();
11th Jan 2018, 7:36 PM
mustafacqn can
mustafacqn can - avatar