Results 1 to 2 of 2
- 09-10-2012, 01:23 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 55
- Rep Power
- 0
main method in super or abstract class
Hi all,
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)
{
System.out.println("hii");
}
}
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.
Thank you.
- 09-10-2012, 01:54 PM #2
Re: main method in super or abstract class
My comment in Equals 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.
db
THREAD CLOSED
edit
Also
Thread !!
List IteratorLast edited by DarrylBurke; 09-10-2012 at 01:56 PM.
Why do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Whats the different between package.class.method and super.method?
By Pojahn_M in forum New To JavaReplies: 1Last Post: 10-17-2011, 01:00 AM -
abstract method-abstract class
By durgaprasad1407 in forum New To JavaReplies: 1Last Post: 04-29-2011, 06:58 PM -
Class is not abstract and does not override abstract method run(com.
By rgeurts in forum New To JavaReplies: 4Last Post: 04-14-2011, 11:42 AM -
super class reference variable accesses overriding sub class method
By subith86 in forum New To JavaReplies: 5Last Post: 01-26-2011, 06:38 PM -
Difference between Abstract class having only abstract method and a Interface class
By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 10:51 AM


LinkBack URL
About LinkBacks

Bookmarks