Results 1 to 2 of 2
- 09-10-2012, 01:23 PM #1Member
- Join Date
- Jan 2012
- Rep Power
main method in super or abstract class
I wrote a simple code mentioned below and am not able to understand the way the output is generated.
abstract class Abc
public static void main(String args)
class Cont extends Abc
When i save the above program as Cont.java file and run it, it displays the output as hii. Can any one explain how did that happen? shouldn't there be runtime exception saying main method not found? Kindly help.
- 09-10-2012, 01:54 PM #2
Re: main method in super or abstract class
My comment in http://www.java-forums.org/new-java/...tml#post289849 still stands.
I'm closing this thread. Please feel free to ask the question again after going through the link I provided in the other thread.
Last edited by DarrylBurke; 09-10-2012 at 01:56 PM.If you're forever cleaning cobwebs, it's time to get rid of the spiders.
- By Pojahn_M in forum New To JavaReplies: 1Last Post: 10-17-2011, 01:00 AM
- By durgaprasad1407 in forum New To JavaReplies: 1Last Post: 04-29-2011, 06:58 PM
- By rgeurts in forum New To JavaReplies: 4Last Post: 04-14-2011, 11:42 AM
- By subith86 in forum New To JavaReplies: 5Last Post: 01-26-2011, 07:38 PM
- By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 11:51 AM