answersLogoWhite

0

No. The abstract keyword means that you cannot instantiate the class unless you extend it with a subclass. The final keyword means that you cannot create subclasses of that class.

Combining them would lead to an unusable class, so the compiler will not let this happen.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

Difference between abstract and final class?

Abstract class is built to promote inheritance whereas a final class is built to avoid inheritanceAn Abstract class can be extended by another class whereas a final class cannot be extended


When do you declare method or class final?

final is a keyword.it can be used for three posibilities. they are ->we can assign the variable as final. to declaring the variable as final to avoid the reusability of a variable. now i display small program for this type. class A { final int i=10; a(int b) { i=b; System.out.println(i); } } public static void main(String args[]) { A x=new A(20); } } to execute this program .we have an error message.i.e.,the variable i can not be override. ->to use method have final keyword it can not be override.and also ->to use classes has final they can not be inhereted to sub classes.


A final class can have instances?

Yes. You cannot inherit a final class but very well instantiate a final class


Write EBNF descriptions for A java class definition header statement?

® {} class [extends class_name] [implements {, }] ® public | abstract | final ® {} class [extends class_name] [implements {, }] ® public | abstract | final


What is difference between abstract class and interface in core java give brief answer with example?

Differences:Abstract class can also contain method definitions but an interface can contain only declarationsAll variables in an interface are by default public static and final whereas in Abstract class it is notAn interface can be considered as a pure abstract class that contains no method implementations and contains only declarations.

Related Questions

Can you define a class as final and abstract both?

Yes, a class can be defined as final and abstract also.


Difference between abstract and final class?

Abstract class is built to promote inheritance whereas a final class is built to avoid inheritanceAn Abstract class can be extended by another class whereas a final class cannot be extended


What is the difference between abstract class and final class?

20


When do you declare method or class final?

final is a keyword.it can be used for three posibilities. they are ->we can assign the variable as final. to declaring the variable as final to avoid the reusability of a variable. now i display small program for this type. class A { final int i=10; a(int b) { i=b; System.out.println(i); } } public static void main(String args[]) { A x=new A(20); } } to execute this program .we have an error message.i.e.,the variable i can not be override. ->to use method have final keyword it can not be override.and also ->to use classes has final they can not be inhereted to sub classes.


A final class can have instances?

Yes. You cannot inherit a final class but very well instantiate a final class


Write EBNF descriptions for A java class definition header statement?

® {} class [extends class_name] [implements {, }] ® public | abstract | final ® {} class [extends class_name] [implements {, }] ® public | abstract | final


What is difference between abstract class and interface in core java give brief answer with example?

Differences:Abstract class can also contain method definitions but an interface can contain only declarationsAll variables in an interface are by default public static and final whereas in Abstract class it is notAn interface can be considered as a pure abstract class that contains no method implementations and contains only declarations.


What can be declared in an abstract class?

Abstract classes are to be extended until to a concrete class.Can have both abstract & non abstract methods.An Abstract class can not be instantiated.A non abstract class can be extended to an abstract class.If At least one abstract method present in a class then that class must be abstract.abstract & final modifiers can never be together.abstract classes can have both abstract methods & non abstract methods.


What is an abstract class Write the syntax Declare a pure virtual function in an abstract class?

an abstract class is nothing but class which contains both abstract and concrete methods for abstract class we r nt create object Syntax for pure abstract class is abstract class x { public void abstract y(); public void abstract z(); public void abc() { }


What is the difference between abstract class and normal class?

Any class which has one or more abstract methods is called an abstract class. But in the normal class we can't have any abstract methods. We cannot create an object for the abstract classes. When we inherit the abstract class we should implement the abstract method which we inherit.


Why can't declare construtor as a static final abstract?

Because of the following reasons:static - If a constructor is static, an object instance cannot invoke it to initialize itself (Because static members are not linked to an object)abstract - because an abstract class cannot be instantiated and hence it will not have a constructor. If you make a concrete class's constructor abstract - it cannot be instantiated. eitherways it makes no sensefinal - a constructor cannot be final (thats the way java is designed)


How do you call an abstract class from main method?

An abstract class cannot have a constructor and hence you cannot invoke the constructor of the class - i.e., you can instantiate an abstract class and hence you cannot call the constructor of an abstract class.