answersLogoWhite

0


Best Answer

abstract all lower case.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the keyword used to declare a class which cannot be instantiated?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What happens if an abstract modifier is applied to class. Explain?

The classes which have one or more abstract methods are abstract. To declare a class as abstract, use the abstract keyword in front of the class keyword, before the class declaration. Abstract classes cannot be instantiated. Similarly the new keyword cannot be used to create an object of the abstract class. Remember that the constructors and static variables cannot be declared as abstract. Any subclass of an abstract class must either implement all of the abstract methods in the superclass or be itself declared abstract.


What is the relationship between inheritance methods and the keyword final?

They are inversely related. That is: If you declare a method as final you cannot overridden in the child class If you declare a class as final you cannot inherit it in any other class.


What exception will be thrown when abstract class is instantiated?

None. Because an abstract class cannot be instantiated.


Is it true that Abstract class objects never have to be instantiated?

Yes. An Abstract class cannot be instantiated.


Why do you use constructors?

A constructor lets you write code that will be executed when the class is instantiated with the "new" keyword.


How constructor called?

You cannot invoke a constructor explicitly. It will get invoked implicitly when you call the new keyword on the class to create an object of the class. Ex: private ClassExample obj = new ClassExample(); here this new keyword usage on the ClassExample class will invoke the constructor of this class and create an object of that class.


Can you have a final abstract class?

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.


What if a final keyword is applied to a function?

The final keyword in JAVA means that the class can no longer be derived, i.e. it cannot be used as a base class for a new child class.If you declare a method as final, this method cannot be overridden in any of the child class that may extend this class.


The Java keyword is used to declare a class as a subclass of another class?

class MyClass extends AnotherClass {}


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)


In Java can an interface be final?

No. Interfaces themselves cannot be instantiated, so in order to be useful you must make a subclass. The final keyword will make a class unable to be extended, which would defeat the point of using an interface.


What is the final keyword in Java?

The final keyword precedes a declared constant which after Instantiation cannot be modified. Examples. final double PI = 3.14; PI = 1234; // does not compile //or final double ONE; ONE = 1; // Instantiated ONE = 2; // does not compile ---------------------------------------- final keyword can also apply to a method or a class. When applied to a method - it means the method cannot be over-ridden. Specially useful when a method assigns a state that should not be changed in the classes that inherit it, and should use it as it is (not change the method behaviour). When applied to a class it means that the class cannot be instantiated. A common use is for a class that only allows static methods as entry points or static final constants - to be accessed without a class instance. A good example is Java's: public final class Math extends Object