Tuesday , October 25 2016
Home / JAVA / Constructor in Java

Constructor in Java

In Java Constructor is a block of code which gets executed automatically when object of that class is created. It is not a function so does not return any value. Name of a class and a constructor should be same. Constructor and functions are same only with difference that constructor runs automatically after the initialization of object. Constructor can be called only once when the object is created.


Also See:   Binary Search Program in Java

constructor in java

Check Also

Program for Matrix Multiplication in JAVA

Announcement: Know how other students are getting higher education from abroad (US, UK, Germany) and ...

Leave a Reply

Your email address will not be published. Required fields are marked *

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.