Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How do you call the constructor?

807603Jan 9 2008 — edited Jan 10 2008
I must be losing my mind, this seems so simple.

I've got a class aaa.java with a constructor as follows:

public void aaa()
{
System.out.println("hello");
}

And then in my main class I call as follows:

aaa bbb = new aaa();

Should this call the constructor of the aaa() class and run the println statement? I must be missing something stupid. It's running through fine, just not hitting the constructor.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 7 2008
Added on Jan 9 2008
5 comments
98 views