File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Abstract class" Watch "Abstract class" New topic
Author

Abstract class

Arsho, Ayan
Ranch Hand

Joined: Nov 14, 2001
Posts: 60
Is it a must for a abstract class to have a abstract method?

Thanks
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
yes.

regards,
maulin.
Arsho, Ayan
Ranch Hand

Joined: Nov 14, 2001
Posts: 60
No ... because interface is a class and all the members are implicitly abstract.

Regards
Guoqiao Sun
Ranch Hand

Joined: Jul 18, 2001
Posts: 317
Hi, Arsho:
You can define a class as abstrat even if there is no abstract method in that class. And if there is really one abstract method in some class, you must define that class as abstract.
Regards,

------------------
Guoqiao Sun
Sun Certified Programmer for Java™ 2 Platform
try my mock exam¹²³ at my homepage.


Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum
Arsho, Ayan
Ranch Hand

Joined: Nov 14, 2001
Posts: 60
Hi Sun :
My point was since an interface has all methods implicitly abstract , but we do not use keyword abstract right...
i agree with you for normal classes the use of keyword abstract
Thanks
[Your exams are indeed very good]
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4711
    
    7

Originally posted by Arsho, Ayan:
My point was since an interface has all methods implicitly abstract , but we do not use keyword abstract right...

Yes, but your original question did not mention interface:
"Is it a must for a abstract class to have a abstract method?"

Unless that was a trick question...
BTW, there are no trick questions in the exam; just tricky ones

Junilu

[This message has been edited by JUNILU LACAR (edited November 16, 2001).]


Junilu - [How to Ask Questions] [How to Answer Questions]
Ragu Sivaraman
Ranch Hand

Joined: Jul 20, 2001
Posts: 464
Originally posted by Arsho, Ayan:
Hi Sun :
My point was since an interface has all methods implicitly abstract , but we do not use keyword abstract right...
i agree with you for normal classes the use of keyword abstract
Thanks
[Your exams are indeed very good]

your point is right. I agree. But using abstract inside a interface is not wrong. It is just bad practice that's all
Ragu
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Abstract class