Skip to content
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
ICT BYTE Logo ICT BYTE

Nepal's #1 Tech Blog

ICT BYTE Logo ICT BYTE

Nepal's #1 Tech Blog

  • HOME
  • GADGETS
    • MOBILE
    • LAPTOPS
    • SMARTWATCH
    • TABLETS
  • EVENTS
  • NEPAL
    • Banking
    • B.Sc. CSIT
    • BCA
  • MCS
    • 1st Sem
      • Managerial Communication
      • Object Oriented Programming
      • Open Source Technology
      • Design and Analysis of Algorithm
    • 2nd Sem
    • 3rd Sem
    • 4th Sem
  • Utility Tools
    • .np Cover Letter Generator
    • Image Size Reducer
  • HOME
  • GADGETS
    • MOBILE
    • LAPTOPS
    • SMARTWATCH
    • TABLETS
  • EVENTS
  • NEPAL
    • Banking
    • B.Sc. CSIT
    • BCA
  • MCS
    • 1st Sem
      • Managerial Communication
      • Object Oriented Programming
      • Open Source Technology
      • Design and Analysis of Algorithm
    • 2nd Sem
    • 3rd Sem
    • 4th Sem
  • Utility Tools
    • .np Cover Letter Generator
    • Image Size Reducer
Subscribe
Close

Search

Trending Now:
nepal budget latest tech updates trends
Masters of Computer ScienceObject Oriented Programming

Types of Constructor in Java | Chain of Constructor

By ICT Byte
1 Min Read
0

Last Updated on 5 years ago by ICT Byte

  • Types of Constructor
  • Destructor
  • Finalize() Methods
  • Chain of Constructor

Types of Constructor

  • Default Constructor
    • Doesn’t have any parameter
    • Example

Class rectangle{

rectangle(){

System.out.println(“Default Constructor”);

  • No argument constructor
  • Parameterized Constructor
    • Has parameter
    • When object is initialized, parameters are taken
    • Example

Class rectangle{

Int length, breadth;

rectangle(int l, int b){

length=l;

breadth=b;

}

int area(){

Destructor

  • There is no destructor in java as of C++
  • There is automatic garbage collector – it frees the dynamically allocated memory when there is no use

Finalize() Methods

  • Works like destructor
  • Opposite of constructor
  • Finalize method is used – for removing object

Chain of Constructor

  • Process of calling constructor from another constructor
  • Can be done in two ways
    • Within same class: Using this() keyword
    • From base class : Using super() keyword
  • It goes with inheritance

Tags:

chain of constructordefault constructordestructorfinalize() methodno arguement constructorparameterized constructortypes of constructor in java
Author

ICT Byte

Follow Me
Other Articles
etiquette
Previous

What is Etiquette? Know about Etiquette in Workplace, Telephone Etiquette, Online Etiquette and more!

Next

Invoking Base Class Constructor in JAVA

Copyright 2026 — ICT BYTE. All rights reserved. Blogsy WordPress Theme