Quantcast
Channel: Java this in parent and child not working as expected - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Prasad Kharkar for Java this in parent and child not working as expected

$
0
0
  • Your getS() methods from parent class is inherited in Child class and hence it is available for Child object.
  • Overriding is only for methods and not for instance variables.
  • So even if you define a new variable with same name, it will not take effect as it will not be overridden

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>