Answers for "can we inherit final method in java"

0

can we inherit final method in java

class Demo{
   public final void demoMethod(){
      System.out.println("Hello");
   }
}
public class Sample extends Demo{
   public final void demoMethod(){
      System.out.println("demo method");
   }
   public static void main(String args[]){
      Sample obj = new Sample();
      obj.demoMethod();
   }
}
Posted by: Guest on August-27-2021

Code answers related to "can we inherit final method in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language