answersLogoWhite

0


Best Answer

Actually there is no need & most importantly - you cannot create an abstract class without using the abstract keyword

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the need to create an abstract class without abstract?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can abstract class have constructors?

A constructor of a class in invoked when a object of that class is created. As an abstract class can't have an object, so we can't create a constructor of the abstract class. But we can create a constructor of a concrete subclass of that abstract class and we have to pass the object of that concrete subclass to the abstract class.


What are abstract classin java?

An Abstract class is a special kind of class that cannot be instantiated. It has one or more methods which are not implemented in the class. These methods are declared abstract and they do not contain any code inside them.Ex:abstract class Parent {public abstract String getSon();public abstract String getDaughter();........//More methods that contain specific behaviour/code in them}The above is an abstract class "Parent" that has a lot of functionality but it has declared two abstract methods which have no code inside them. Any class that has one or more abstract methods has to be abstract. This abstract class cannot be instantiated.i.e., the below piece of code will not work. The code will not even compile.Parent object = new Parent();Purpose of Abstract Classes:Abstract classes are generally used where you want an amount of behaviour to be used by the class that extends the abstract class while at the same time giving options to the child class to provide a certain amount of behaviour itself.A Child Class extending the Abstract Class:public class Child extends Parent {public String getSon() {return "Sons Name";}public String getDaughter(){return "Daughters Name";}...... //Code specific to the Child class}


Is an abstract class virtual by default?

Unlike abstract class in C++, the abstract class in C# does not have any methods defined as virtual by default. The concept of virtual are not the same between C# and C++, either. Any virtual method must be defined explicitly in C#. Related to abstract methods - interestingly, an abstract class in C# does not have to have any abstract methods. However, the reverse, if a class need to have at least one abstract method, that class must be defined as abstract.


Is it necessary to implement all the methods of abstract classes in derived class?

An Abstract class is a way to organize inheritance, sometimes it makes no since to implement every method in a class (i.e. a predator class), it may implement some to pass to its children but some methods cannot be implemented without knowing what the class will do (i.e. eat() in a Tiger class). Therefore, abstract classes are templates for future specific classes. A disadvantage is that abstract classes cannot be instantiated, but most of the time it is logical not to create a object of an abstract class. heloooooo


What are the differences between class and abstract class?

Below is the main difference between the 3 components:Concrete class - Provides implementation for all its methods & also for methods from extended abstract classes or implemented interfacesAbstract class - Does not provide implementation for one or more of its methodsInterface - Does not provide implementation for any of its methods

Related questions

Can abstract class have constructors?

A constructor of a class in invoked when a object of that class is created. As an abstract class can't have an object, so we can't create a constructor of the abstract class. But we can create a constructor of a concrete subclass of that abstract class and we have to pass the object of that concrete subclass to the abstract class.


How do you create a class on cod5 without Xbox live?

actually you can't. you need xbox live in order to do create-a-class. Cod: MW2 on the other hand, you don't need xboxlive for that.


What are abstract classin java?

An Abstract class is a special kind of class that cannot be instantiated. It has one or more methods which are not implemented in the class. These methods are declared abstract and they do not contain any code inside them.Ex:abstract class Parent {public abstract String getSon();public abstract String getDaughter();........//More methods that contain specific behaviour/code in them}The above is an abstract class "Parent" that has a lot of functionality but it has declared two abstract methods which have no code inside them. Any class that has one or more abstract methods has to be abstract. This abstract class cannot be instantiated.i.e., the below piece of code will not work. The code will not even compile.Parent object = new Parent();Purpose of Abstract Classes:Abstract classes are generally used where you want an amount of behaviour to be used by the class that extends the abstract class while at the same time giving options to the child class to provide a certain amount of behaviour itself.A Child Class extending the Abstract Class:public class Child extends Parent {public String getSon() {return "Sons Name";}public String getDaughter(){return "Daughters Name";}...... //Code specific to the Child class}


Is an abstract class virtual by default?

Unlike abstract class in C++, the abstract class in C# does not have any methods defined as virtual by default. The concept of virtual are not the same between C# and C++, either. Any virtual method must be defined explicitly in C#. Related to abstract methods - interestingly, an abstract class in C# does not have to have any abstract methods. However, the reverse, if a class need to have at least one abstract method, that class must be defined as abstract.


Is it necessary to implement all the methods of abstract classes in derived class?

An Abstract class is a way to organize inheritance, sometimes it makes no since to implement every method in a class (i.e. a predator class), it may implement some to pass to its children but some methods cannot be implemented without knowing what the class will do (i.e. eat() in a Tiger class). Therefore, abstract classes are templates for future specific classes. A disadvantage is that abstract classes cannot be instantiated, but most of the time it is logical not to create a object of an abstract class. heloooooo


What are the differences between class and abstract class?

Below is the main difference between the 3 components:Concrete class - Provides implementation for all its methods & also for methods from extended abstract classes or implemented interfacesAbstract class - Does not provide implementation for one or more of its methodsInterface - Does not provide implementation for any of its methods


Compare anonymous class with abstract class?

Abstract Classes contain the work abstract in it. It is used when you know that you will need to use an object of its type but do not know the inner workings yet. Anonymous classes are those classes that are constructed on the fly. You need to know its inner workings.


Is an abstract class cannot have any member variable in C plus plus?

An abstract base class may have member variables. Whether or not it actually needs member variables depends on the nature of the base class itself. If the variable is common to all derived classes, then it makes sense to place the variable in the base class. If some derived classes have no need of the variable, then it is better to derive an intermediate class with the variable, and to derive those classes that require that variable from the intermediate class, rather than directly from the abstract class.


What is an interface class and what is an abstract class?

The term interface class does not exist in C#. If this is a term describing a class being an interface to other component (human, subsystems, etc), it is very application specific. The designer of that application should know the abstraction.However, C# does have another type called interface. An interface is NOT a class. An interface defines the intention of some behaviors that classes may be extended it and provides the implementation. The intention, is nothing but method signatures, which defines the return data type, the method name, and any method arguments and associated data type. The implementation is the code of the method. Interface is used for separating the concern of design and implementation.Abstract class is a class with abstract keyword. It can be just like a class without that keyword (then, why it is an abstract class?). But it may have some methods or properties defined as abstract. These abstract methods, like the method signatures of an interface, defines the intention.The subclasses of such an abstract class would need to implement those abstract methods (providing the code).There are more common, differences between interfaces and abstract classes, please see answer(s) of those related questions in C# category.


How do you get gold guns in black ops without glitching?

all you need to do is when you create a class make your camo gold then you will have a gold gun


How can you use abstract classes instead of interfaces?

In most cases, you will want to use abstract classes IN ADDITION to interfaces.You should use an abstract class in the following circumstance:the abstract class is clearly part of class hierarchy, and does not just describe some sort of basic functionality. Specifically, abstract classes are a good idea where they will be directly inherited from to create a concrete concept, but the abstract class itself is too indistinct to have any specific instance of it created.You want to provide an implementation for a set of methods that will be reused by a significant number of other classes, all of which can be fit into a class hierarchy.In practice, abstract classes are a good way to collect common code into one place, to make maintenance easier.For instance, say you have a class and interface structure like this:Class AInterface XClass B extends A implements XClass C extends A implements XBoth B and C will have the all the methods declared in X; if the implementation of those methods is the same (or can be made the same), then X is a good candidate for changing to an abstract method:Class AAbstract Class X extends AClass B extends XClass C extends XThus, you have removed the code duplication that was happening when using interfaces.Note that doing the above is NOT a good idea if any class which implement interface X cannot be made a subclass of the new abstract class X.


What is difference between interface and abstract class?

All the methods declared inside an Interface are abstract. Where as abstract class must have at least one abstract method and others may be concrete or abstract. In Interface we need not use the keyword abstract for the methods.