Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Are virtual calls a test topic?

 
Kendall Ponder
Ranch Hand
Posts: 205
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are virtual method calls a test topic? Thanks!
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you provide an example what you mean with "virtual calls"?
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are referring to method overriding and polymorphism, the answer is definitely "yes".

Given this code snippetwhich method will be executed when you run this code
 
Kendall Ponder
Ranch Hand
Posts: 205
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was an Euthuware test question. If it doesn't violate any rules I will list it. It listed several method calls and asked which of them were "virtual calls".
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you clearly mention your sources (which you already did), I don't think you'll be violating any rules. And if the author (Enthuware in this case) is not happy and wants it removed, we can always edit your post and remove the part they are not happy about (but frankly I don't think they will have any objection sharing these different method calls).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exam doesn't ask you to identify virtual calls by name. You have to be able to read code that contains virtual calls and know what the result is. (Which is easier).
 
Kendall Ponder
Ranch Hand
Posts: 205
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:If you clearly mention your sources (which you already did), I don't think you'll be violating any rules. And if the author (Enthuware in this case) is not happy and wants it removed, we can always edit your post and remove the part they are not happy about (but frankly I don't think they will have any objection sharing these different method calls).


Here is the code:
They then list method calls (such as x.mB();) and ask which ones are virtual calls.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kendall Ponder wrote:They then list method calls (such as x.mB();) and ask which ones are virtual calls.

That's what I assumed in my reply with the code snippet. So you could rephrase the question: which method invocations are examples of polypmorphism? And based on the code snippet you provided, you can rule out plenty of options I don't want to spoil your fun, so I'm not telling you which ones
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic