File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Signature question

 
Anup Engineer
Ranch Hand
Posts: 48
  • 0
  • 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
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic