JAVA PROGRAM TO UNDERSTAND FINAL METHOD

 class XYZ{  

   final void demo(){

      System.out.println("XYZ Class Method");

   }  

}  

     

class ABC extends XYZ{  

   void demo(){

      System.out.println("ABC Class Method");

   }  

     

   public static void main(String args[]){  

      ABC obj= new ABC();  

      obj.demo();  

   }  

}

Comments

Popular posts from this blog

JAVA RECORD PROGRAM FOR AREA AND PERIMETER OF RECTANGLE

JAVA RECORD PROGRAM FOR FIBBONACCI SERIES

JAVA RECORD PROGRAM FOR MATRIX MULTIPLICATION