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

Invoking Base Class Constructor in JAVA

By ICT Byte
1 Min Read
0

Last Updated on 5 years ago by ICT Byte

Invoking Base Class Constructor

  • To invoke base class constructor , super keyword is used

// Java program for demonstration of inheritence

class Mcs {

    // Creating method method1 for class Mcs

    public void method1()

    {

      System.out.println(“mcs”);

    }

}

class Oop extends Mcs {

    // Creating method method2 for class oop

    public void method2()

    {

      System.out.println(“oop”);

    }

}

public class IB {

    public static void main(String[] args)

    {

        // Creating Obj for Class Oop and

        // Calling both method1 from class mcs

        // And calling method2 from class oop respectively.

        Oop obj = new Oop();

        obj.method2();

        obj.method1();

    }

}

Objects and Arrays

Tags:

base class constructorsuper keyword
Author

ICT Byte

Follow Me
Other Articles
Previous

Types of Constructor in Java | Chain of Constructor

google courses
Next

Top 5 Free Google Courses & Certification for 2021

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