Two Laptop Bag
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Default constructor ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Default constructor ? " Watch "Default constructor ? " New topic

Default constructor ?

Sim Kim
Ranch Hand

Joined: Aug 06, 2004
Posts: 268
Which two are true ?

A. The default constructor initializes method variables.
B. The compiler always creates a default constructor for every class.
C. The default constructor invokes the no-parameter constructor of the superclass.
D. The default constructor initializes the instance variables declared in the class.
E. When a class has only constructors with parameters, the compiler does not create
a default constructor.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I think C & E are correct .
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272

Mike Gershman
SCJP 1.4, SCWCD in process
I agree. Here's the link:
subject: Default constructor ?
It's not a secret anymore!