Quantcast
answersLogoWhite
notificationBell

Top Answer
User Avatar
Wiki User
Answered 2012-01-20 06:58:10

public abstract class class_namne{

public abstract void method()

{}

}

001
🙏🏿
0
🤨
0
😮
0
😂
0
User Avatar

Your Answer

Still Have Questions?

Related Questions

Can you declare final method in abstract class?

Yes, you can declare a final method in an abstract class. However, that method cannot be abstract itself.


When do you declare a method or class abstract in java?

when overriding of a class or a method is necessary, they can be declared as abstract


How do you declare class as an abstract?

//We Declare an abstract class as-abstract class Car{}//Example of an abstract methodabstract void hondaCity(); //no method body and abstract//Example of Abstract class that has an abstract methodabstract class Car{abstract void run();}class HondaCity extends Car{void run(){System.out.println("runs smartly");}public static void main(String args[]){Car obj = new HondaCity();obj.run();}}//OUTPUT will be-runs smartly


What is abstract class and abstract method?

An Abstract method is one that has only a method declaration and no method definition. Similarly an abstract class is one that has one or more abstract methods. You can declare an abstract class or methods by using the keyword abstract in the class definition. Ex: public abstract class TestAbsClass { abstract void method1(); } Any class that extends this abstract class must provide implementation to the method "method1" or else it would have to be abstract as well.


How do you use an abstract method?

Abstract method has no body(only declare). To use an abstract method you have to override it .


What is abstract class in Java?

a abstract class is class which has a abstract method which means a method does not its own body.


What are the differences between class and abstract class?

Normal variables or static variables are declared and use in class but abstract class had only static variables. You have declare and define the methods in class. But abstract class only allow for method declaration only. The abstract class like interface.


Why don't use abstract keyword when we declare a method in interface?

The abstract keyword signifies that the particular method will have no features in the class where it is declared and it is upto the child class to provide the functionality. In case of an interface, the method is already abstract by default and has no code inside it. So there is no actual point in using the abstract keyword there.


When do you declare a method or class final?

if we declare a method as final then it can be changed.


What is an abstract factory class?

An abstract factory class is a class which has an abstract method to create an object.


Can an interface have a abstract method?

No! abstract is a key word for saying "Don't make a reference variable of this class" A interface is a abstract class and you have to implement it. When you do this all your doing is making sure that what ever class your putting in to wont compile unless less you at least declare the method. It doesn't have to do anything or event have a body.


Does abstract class contain the definition of non abstract method in java?

yes,abstract class can have non abstract methods,even it can have all non abstract method


What is abstract data type in?

Abstract is the data type which can be used at method and class level... The abstract keyword which we used at method level makes that method as abstract means not giving implementation for that method.. the abstract keyword which used at the class level , restrict developers not to create the object of that class.


What is an abstract method?

An abstract method is a method, in object-oriented software, of an abstract class which has to be implemented by all subtyping classes.


Abstract keyword in java?

Abstract keywordused for method declaration declares the methods without implementations. Abstract class in java have abstract methods that is not implemented in abstract class, but implemented in subclasses in java program. If the class in java program is not required to get instantiated than that class use the abstract keyword but this class rather is available for other classes to extend by other classes. Abstract keyword will be used in method declaration to declare that method without providing the implementation in that java program. In other words we can say that, it formally unfinished class as well as method, that marked with the help of keyword abstract. Defining abstract is a way of preventing someone from instantiating a class that is supposed to be extended first. In java program abstract class is deliberately missing similar to like an interface which will missing all method bodies in the program. Abstract class provides a way to extend an actual class. We will not use new on abstract classes but will use abstract references in the java program, that always point to objects of the class that extends an abstract class. In java program for practical use of an abstract class, we will define a non-abstract class that extends an abstract one. This will use any of the inherited non-abstract methods. Most of the time abstract class may extend another abstract class. In that condition it need not implement all in the non-abstract methods. An abstract keyword used both on classes and methods. In case of class declared with an abstract keyword may not be instantiated that is the only thing that abstract keyword doing.


How do you write concrete method inside abstract class?

There is no difference with method declaration and implementation between abstract and non-abstract classes. You do the exact same thing when writing a concrete method in either an abstract or non-abstract class.


When do you declare a method or a class final in java?

You declare a class final when you don't want any other classes to be able to extend that class. You declare a method final when you don't want any subclasses to be able to override that method.


What is difference between an overridden method and an abstract method?

An overridden method is one which has already been implemented in the parent class with the same signature but has again been coded in the current class for functionality requirements. An abstract method is one which has only been declared in a class and would have to be implemented by the class that extends this abstract class. The implementation for the method is not available in the class in which it is declared.


What is purpose of An Abstract Class in java?

Abstract keyword used for method declaration declares the methods without implementations. Abstract class in java have abstract methods that is not implemented in abstract class, but implemented in subclasses in java program. If the class in java program is not required to get instantiated than that class use the abstract keyword but this class rather is available for other classes to extend by other classes. Abstract keyword will be used in method declaration to declare that method without providing the implementation in that java program. In other words we can say that, it formally unfinished class as well as method, that marked with the help of keyword abstract. Defining abstract is a way of preventing someone from instantiating a class that is supposed to be extended first. In java program abstract class is deliberately missing similar to like an interface which will missing all method bodies in the program. Abstract class provides a way to extend an actual class. We will not use new on abstract classes but will use abstract references in the java program, that always point to objects of the class that extends an abstract class. In java program for practical use of an abstract class, we will define a non-abstract class that extends an abstract one. This will use any of the inherited non-abstract methods. Most of the time abstract class may extend another abstract class. In that condition it need not implement all in the non-abstract methods. An abstract keyword used both on classes and methods. In case of class declared with an abstract keyword may not be instantiated that is the only thing that abstract keyword doing.


How do you create a concrete method inside abstract class?

The same way you create a concrete method in a concrete class. When a class is abstract, it can contain abstract methods. That doesn't mean that all methods must be abstract. Hope this helps.


Why cannot abstract classes be instantiated?

abstract class in java is mainly designed for giving abstract method i.e declarations alone, Instantiation is a process by which jvm allocates memory for that. But only with the method declaration jvm will not know how much memory should give for the abstract method. So abstract classes are no need to instantiate before the method implementation, The concrete class which extends the abstract class, will provide method implementation at that time only abstract class constructor will run


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 are abstract method in java?

An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon), like this: abstract void add(double X, double Y);If a class includes abstract methods, the class itself must be declared abstract


What is similarities between Abstract Class and Interface?

If a class has one abstract method ,the class has to be an abstract class.Methods can be implemented in abstract class.Whereas a interface is like a abstract class...the only difference being that the methods are never implemented in Interface.


Why you are using abstract method?

An abstract method is one that only has a declaration but no definition. An abstract method is usually part of an abstract class. You would typically want to define an abstract class when you want to create an outline of what you want your child classes to do/implement. But, at the same time want to ensure that certain functionality of all your child classes is defined by you. An Abstract class can have both method definitions as well as implementations. So, both of the above can be done in an abstract class. Whereas, an Interface can only have method declarations with no definitions.


Still have questions?

Trending Questions
Best foods for weight loss? Asked By Wiki User
Does Neil Robertson wear a wig? Asked By Wiki User
Previously Viewed
Unanswered Questions
Saan nagmula ang gitara? Asked By Wiki User
Uri ng tekstong nareysyon? Asked By Wiki User
Can you get Takis at 7 eleven? Asked By Wiki User