What is a Constructor in Object Oriented Programming?

Posted by Unknown Rabu, 29 Januari 2014 0 komentar
Constructor is specialized method that is contained in a class. Constructor will be triggered automatically when an object is created. Purpose of the Constructors is to initialize an object of a class.

Constructor’s name is identical to the Class name. Constructors can take parameters but constructors have no return type. This is because; constructors return an object by itself.

Static Constructor
When a constructor of a class is marked with static modifier, then the constructor is called static constructor. Unlike other constructors, Static constructor cannot be triggered while creating instances of that class.

Static constructors will be automatically triggered when the class is loaded for the first time. Static constructors are used to initialize values for the static variables of that class.
TERIMA KASIH ATAS KUNJUNGAN SAUDARA
Judul: What is a Constructor in Object Oriented Programming?
Ditulis oleh Unknown
Rating Blog 5 dari 5
Semoga artikel ini bermanfaat bagi saudara. Jika ingin mengutip, baik itu sebagian atau keseluruhan dari isi artikel ini harap menyertakan link dofollow ke https://androidpopuler.blogspot.com/2014/01/what-is-constructor-in-object-oriented.html. Terima kasih sudah singgah membaca artikel ini.

0 komentar:

Posting Komentar

Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.