• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Signature question

 
Anup Engineer
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question from the mock exam at
http://www.javacaps.com/scjp_mockexams1.html
6. Which of the statements are true?
A) Overridden methods have the same method name and signature
B) Overloaded methods have the same method name and signature
C) Overridden methods have the same method name and different signature
D) Overloaded methods have the same method name and different signature
I thought only D) was true, but it also says A) is true. If the overridden method can have a different thrown exception (though it has to be a subclass of the exception thrown by the base) is it still the same signature?
What exactly constitutes a signature?
Thanks!
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From JLS 8.4.2 Method Signature

The signature of a method consists of the name of the method and the number and types of formal parameters to the method.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic