aspose file tools
The moose likes Beginning Java and the fly likes Default Constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Default Constructor" Watch "Default Constructor" New topic
Author

Default Constructor

Mauro Trevigno
Greenhorn

Joined: Aug 27, 2012
Posts: 18

Hi People,

What class has a default constructor?



Thanks.
Enkita mody
Ranch Hand

Joined: Aug 06, 2012
Posts: 333

Your first class has default constructor.


OCA7
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Mauro Trevigno wrote:
What class has a default constructor?

I can remember one : java.lang.Object . in fact one.
<edit> removed word only </edit>
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 3791
    
    1

The "default constructor" is the one automatically inserted by the compiler if you don't provide one yourself. So it's the first example. The second is a parameterless (or no-arg) constructor, but because you've provided it it isn't considered a default one.
James Boswell
Ranch Hand

Joined: Nov 09, 2011
Posts: 657
    
    2

The default constructor is inserted by the compiler if you do not provide any constructor yourself.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Default Constructor
 
Similar Threads
instanceof question?
default and non-default classes
A class cannot be subclassed...
Accessibility of default constructors
Code within a curly braces