• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about words in compiler error

 
Sergej Smoljanov
Ranch Hand
Posts: 470
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I know this behavior before. My question is why compiler error "overridden method does not throw Exception" and " meth1() in BB cannot override meth1() in AA return type int is not compatible with void" use word overriding not hiding? (i think this is strange)
 
Roel De Nijs
Sheriff
Posts: 10763
148
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume they use "override", because to correctly "hide" such a method the overriding rules apply. So it's probably an extra hint.

These code snippet compiles and demonstrates the use of a few overriding rules:


Hope it helps!
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!