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

Abstract class

 
Arsho, Ayan
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a must for a abstract class to have a abstract method?

Thanks
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.

regards,
maulin.
 
Arsho, Ayan
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No ... because interface is a class and all the members are implicitly abstract.

Regards
 
Guoqiao Sun
Ranch Hand
Posts: 317
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Arsho, Ayan
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 6531
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Ragu Sivaraman
Ranch Hand
Posts: 464
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic