"Alan.J.Thackra y" <al************ *@SPAMBLOCK.blu eyonder.co.uk> wrote in
message news:jq******** *************** *********@4ax.c om...
I am new to Java.
Since the "main" class has the main() function it it, is this called
before the constructor, or is a constructor totally irrelevant for a
main class, since you never "new" it ?
I am used to C++ whare main exists outside any class.
I have a test "main" class and it appears the constructor is never
called ?
Confused !
TIA
Sounds like you actually named your class "main" ????
You should steer clear of class names like that to avoid confusion.
Name a class "Bill" or "George" - even "Sue" - use proper case to follow
convention, and keep away from reserved words.
--- main is a static method, which means you do not need to create an
instance of that class to run the method.
main is *not* a constructor, its a special method.
HTH
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.807 / Virus Database: 549 - Release Date: 12/7/2004