Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can an abstract class contain main() method or not?

 
Pratima Gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Matthew Brown
Bartender
Posts: 4566
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pratima. Welcome to the Ranch!

Your best bet is to try it - that will give you a much more reliable answer than a forum ever will (and faster too).
 
Pratima Gupta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.............
 
BalaMurali dhar
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- edited to remove solution
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this, BalaMurali dhar, which appears at the beginninng of this forum:
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Matthew has correctly suggested Pratima Gupta try it. She will learn so much better by doing something for herself than by being told the answer, as you tried to do. Somebody has accordingly deleted your post, which is the right thing to do in the circumstances.
 
Pablo Abbate
Ranch Hand
Posts: 30
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have just one limitation regarding abstract classes. You can not instantiate one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic