23, నవంబర్ 2024, శనివారం

In Java, abstract class is declared with the abstract keyword. It may have both abstract and non-abstract methods(methods with bodies). An abstract is a Java modifier applicable for classes and methods in Java but not for Variables. In this article, we will learn the use of abstract classes in Java.


 




































































































































































In Java, the following some important observations about abstract classes are as follows:

  1. An instance of an abstract class can not be created.
  2. Constructors are allowed.
  3. We can have an abstract class without any abstract method.
  4. There can be a final method in abstract class but any abstract method in class(abstract class) can not be declared as final  or in simpler terms final method can not be abstract itself as it will yield an error: “Illegal combination of modifiers: abstract and final”
  5. We can define static methods in an abstract class
  6. We can use the abstract keyword for declaring top-level classes (Outer class) as well as inner classes as abstract
  7. If a class contains at least one abstract method then compulsory should declare a class as abstract 
  8. If the Child class is unable to provide implementation to all abstract methods of the Parent class then we should declare that Child class as abstract so that the next level Child class should provide implementation to the remaining abstract method

// Java Program to implement Abstract Class  having constructor, data member, and methods

import java.io.*;

abstract class Subject {

    Subject() { 

      System.out.println("Learning Subject"); 

    }

     

  abstract void syllabus();

       void Learn(){

          System.out.println("Preparing Right Now!");

    }

}


class IT extends Subject {

  void syllabus(){

    System.out.println("C , Java , C++");

  }

}


class absdemo {

    public static void main(String[] args) {

        Subject x=new IT();

           x.syllabus();

          x.Learn();

    }

}

1, నవంబర్ 2024, శుక్రవారం

KARMANYE WADIKARASHTE............... maphalesu kadachana🙏...................Your right is only in doing action (effort), never in the fruits (result) of action. Don’t be desirous of reward of deeds. You may not be attached to inaction either.

 మీ చర్యలపై మీకు హక్కు ఉంది, ఫలాలపై ఎప్పుడూ ఉండదు

చర్య యొక్క ఫలాలు మీ ఉద్దేశ్యంగా ఉండనివ్వండి లేదా మీ అనుబంధం నిష్క్రియాత్మకంగా ఉండనివ్వండి 47 ||

మీ హక్కు చర్య (ప్రయత్నం) చేయడంలో మాత్రమే ఉంటుంది, చర్య యొక్క ఫలం (ఫలితం)లో ఎప్పుడూ ఉండదు. కర్మల ప్రతిఫలాన్ని ఆశించవద్దు. మీరు నిష్క్రియాత్మకతకు కూడా జోడించబడకపోవచ్చు.

doing RIGHT is your job ......but result leave to almighty ......conclusion of GEETHA