Basic computer course, C programming language, Education, Engineering Course, Engineering Courses, Maths Coaching, online computer coaching, PGDCA course coaching, programming course, school computer coaching, training, Uncategorized, Web Design course

What is Constructor? tccicomputercoaching.com

Definition:

Normally method has been executed when manually user call method through object.

But Constructor is a method which execute automatically.

Type-of-Constructors-Uses-in-Java

In Java, a constructor is a block of codes similar to the method. It is called when an instance of the object is created, and memory is allocated for the object.

It is a special type of method which is used to initialize the object.

Types:

There are two types of constructors in Java:

  1. Default constructor (no-arg constructor)

-doesn’t have any parameter.

  1. Parameterized constructor

-has a specific number of parameters

Rules for creating Java constructor

There are two rules defined for the constructor.

  1. Constructor name must be the same as its class name
  2. A Constructor must have no explicit return type
  3. A Java constructor cannot be abstract, static, final, and synchronized

It can also be overloaded like Java methods.

Java has many more important features like Constructor.

To learn these features connect with us @ TCCI Computer Coaching Institute, Ahmedabad.

We teach all Engineering Course,Programming Language,Basic Computer Course,Web Design CourseĀ etc..

For more information about Coaching at TCCI.

Call us @ 98256 18292

Visit us @ http://tccicomputercoaching.com/java-language-course/

 

Leave a comment