-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Constructor
PostPosted: Mon Apr 15, 2013 12:06 am 
Newbie

Joined: Fri Apr 12, 2013 1:53 am
Posts: 18
What is the purpose of creating an empty constructor in a POJO class?

public Employee(){}


Top
 Profile  
 
 Post subject: Re: Constructor
PostPosted: Mon Apr 15, 2013 1:05 am 
Regular
Regular

Joined: Wed Apr 10, 2013 1:02 am
Posts: 50
In java if you don't declare a Const. Then it makes its own which is called as default Const. However now I days frameworks makes it mandatory to declare a no argument construct with a parameterized Constr.

Therefore
First it is used to override default construct and meet pojo specification
Second it used to provide default values like null and - 1

_________________
Regards
Akash Miital
http://akash.thegrassroots.co.in/hibernate/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.