Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
main method
Marie Mazerolle
Ranch Hand
Posts: 81
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
Can anyone tell me why the following won't compile?
public class Super{ public static void main(String args[]){ System.out.println("got in super!"); Child c = new Child(); c.main(); } } class Child extends Super{ public static void main(String args[]){ System.out.println("got in child"); } }
I'm getting a "cannot resolve symbol" error at c.main()
Thanks,
Marie
Jose Botella
Ranch Hand
Posts: 2120
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to the Ranch Marie.
In child main() was not declared but main(
String
[])
SCJP2. Please Indent your code using UBB Code
Marie Mazerolle
Ranch Hand
Posts: 81
posted 21 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Ah darn, my first question on javaranch and it had to be a stupid one.
Thanks Jose,
Marie
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
plz explain and tell out put
Constructor,why displaying null on this program
classes inside an interface
Override main method ?
overriding of static method
More...