This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: Constructor in java
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
Constructor in java is block of code which allows you to create instance of the object. It does not have return type. It has two main points Constructor name should be same as class Constructor should not have any return type else it will be same as method. There are three types of Constructor in Java. Default Constructor No arg constructor Parameterized constructor How to call a constructor? To call a constructor, you need to use the keyword new, followed by the name of class, followed by parameters if any. For example: If you want to create the object of class