In: Computer Science
First of all, let's understand the meaning of Abstract class.
Abstract class:
Answer - Question: 1
Yes, we can extend an abstract class.
abstract class Animal{
public abstract void sound();
}
public class Dog extends Animal{
public void sound(){
System.out.println("Woof");
}
}
Answer - Question: 2
public abstract class AbstractClass{
public String nonAbstractMethod1(int a, int b){
int c = a + b;
return c;
}
public static void nonAbstractMethod2(int c){
System.out.println("Value of c is "+ c);
}
}
Please let me know in the comments in case of any confusion. Also, please upvote if you like.