File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes abstract methods with arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "abstract methods with arguments" Watch "abstract methods with arguments" New topic

abstract methods with arguments

Barry Higgins
Ranch Hand

Joined: Jun 05, 2003
Posts: 89
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,
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

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....

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
please refer to:
Abstract Protocol Support;
Details of a Method Declaration;
Java Developer Connection - Forums
Barry Higgins
Ranch Hand

Joined: Jun 05, 2003
Posts: 89
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.
I agree. Here's the link:
subject: abstract methods with arguments
It's not a secret anymore!