File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract methods with arguments

 
Barry Higgins
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm wondering can anyone tell me how to define an abstract method that requires arguments. I'm thinking something along the lines of the following:
public abstract ActionErrors validate(ActionMapping mapping, HttpServletRequest request);
but this won't compile.
Thanks in advance,
Barry
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Barry, and welcome to JavaRanch!
What error are you getting when trying to compile your code? This looks like it should compile without any problem, assuming:
1). You have imported all necessary packages, and
2). You have declared your class as being abstract.
Check these two things and, if they are not the problem, post back with the exact error message you are receiving....
 
John Lee
Ranch Hand
Posts: 2545
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi:
please refer to:
Abstract Protocol Support;
Details of a Method Declaration;
Java Developer Connection - Forums
 
Barry Higgins
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joel,
Apologies ... I was just about to write back a big mail about how that wasn't working, when I noticed a stupid mistake in the class definition.
It's all good now.
Thanks for you help.
Barry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic