Jumat, 23 Desember 2016

What is constructor invocation in Java Programming

Constructor Invocation: A constructor is invoked (called) automatically whenever an object is created using the new keyword. For example, in the above example, new TicTacToe() calls the constructor of TicTacToe class. If no constructor has been defined, Java automatically invokes the default constructor which initializes all the fields to their default values.   Types of Constructor: Based on the number of parameters and type of parameters, constructors are of three types: Parameter less constructor or zero parameter constructor Parameterized constructor Copy constructor Parameter less constructor: As the name implies a zero parameter constructor or parameter less constructor doesn’t have any

The post What is constructor invocation in Java Programming appeared first on Coding Security.


What is constructor invocation in Java Programming
read more

Tidak ada komentar:

Posting Komentar