Bookmark Topic Watch Topic
  • New Topic

is abstract class can't be instansiated  RSS feed

 
akhter wahab
Ranch Hand
Posts: 151
Java MyEclipse IDE Python
  • Mark post as helpful
  • send pies
  • Report post to moderator
as i know abstract class can't be instansiated , and if it can't be instansiated it must not have the main method too..(Might be i m worng)

here is the code that i write but here abstract class has main method too and in Main class i have made its object too please explain what accentually doing this code and my problem too
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Report post to moderator
You already know (from here) that you can have a static method in an abstract class, and invoke it without instantiating the class. What you are doing both here and in the other thread, is instantiating the abstract class as an anonymous class.

Since we have the same subject matter here and in the other thread, I shall close this thread.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!