abstract-methods Questions
2
Solved
in javaFX Application is an abstract class. In this abstract class there have some abstract methods which are overridden in main class which extends abstract Application class and also have static ...
Incommunicative asked 30/7, 2023 at 15:1
4
Solved
I'm working on a kind of lib, and I'm getting an error.
Here is my code. Of course @abc.abstractmethod have to be uncommented
Here are my tests
Sorry couldn't just copy and paste it
I went on the...
Elbrus asked 16/7, 2015 at 15:0
3
Good evening,
I'm whith a problem on a project whith EJB Timer, I don't know what can I do to fix it.
there are a few methods in my project, all of them works well except "CargaC" When I call it ...
Febrifugal asked 12/5, 2016 at 17:41
7
Solved
In the following code, I create a base abstract class Base. I want all the classes that inherit from Base to provide the name property, so I made this property an @abstractmethod.
Then I created a ...
Wisteria asked 11/5, 2011 at 6:49
5
Solved
In my Python app I want to make a method that is both a staticmethod and an abc.abstractmethod. How do I do this?
I tried applying both decorators, but it doesn't work. If I do this:
import abc
cl...
Josselyn asked 17/12, 2010 at 20:11
2
Solved
I have a module fi with the following classes defined:
class Asset(metaclass=abc.ABCMeta):
pass
@abc.abstractmethod
def get_price(self, dt : datetime.date, **kwargs):
''' Nothing here yet
''...
Reverie asked 12/8, 2015 at 19:12
2
Solved
I have read python docs about abstract base classes:
From here:
abc.abstractmethod(function)
A decorator indicating abstract methods.
Using this decorator requires that the class’s metaclas...
Anaplasty asked 25/8, 2011 at 19:53
9
Solved
I understand that in abstract classes methods be both abstract, or not. But why can I not create an abstract method in a "normal", non-abstract class?
Thanks in advance for any explanation!
Chiropody asked 4/3, 2014 at 1:45
1
Solved
In django abstract classes seem to be posibble by using:
class Meta:
abstract = True
However I do not see how to declare abstract methods/functions within these classes that do not contain
any...
Caddaric asked 29/3, 2020 at 21:19
2
Consider the following code example
import abc
class ABCtest(abc.ABC):
@abc.abstractmethod
def foo(self):
raise RuntimeError("Abstract method was called, this should be impossible")
class ABCt...
Sabol asked 23/5, 2016 at 19:24
3
Solved
I am trying to design one Abstract class and method in Android and call those methods by extending the class from my parent Activity class but I don't how to call my abstract method.
MyCode :
MainA...
Darin asked 17/12, 2015 at 9:43
4
Solved
Q. Are you still following the principle of Program to an Interface if you are creating abstract methods in an abstract class that is not linked to an interface?
I use an Interface already for all...
Pomeranian asked 16/8, 2014 at 19:35
3
Solved
When overriding a python abstract method, is there a way to override the method with extra parameters in the method signature?
e.g.
The abstract class =
Agent(ABC):
@abstractmethod
def percei...
Fumigate asked 24/4, 2018 at 18:7
1
Solved
I was reading official python documentation.
In the mentioned link, the second line states that:
Using this decorator requires that the class’s metaclass is ABCMeta or
is derived from it.
Bu...
Hilaryhilbert asked 1/3, 2018 at 14:17
4
Solved
I have a situation where I need to modify the super class method to have a subclass specific logic, but the methods logic is same for all other subclasses.
I have two options:
1) make the method...
Namara asked 6/1, 2018 at 6:9
1
Solved
I have an abstract class, Model, with a few abstract methods, what should I put in the body of the methods?
A return
class Model(metaclass=ABCMeta):
@abstractmethod
def foo(self):
return
...
Gossipry asked 22/8, 2017 at 20:47
2
Solved
I am new to java and trying some accessing methods and i encountered something that i do not understand. The code below working fine, prints 9 and not giving any compilation errors.
I think this c...
Tojo asked 22/8, 2017 at 12:26
1
Solved
Let's say I have the following class hierarchy:
interface Collection<E>
{
Collection<E> $plus(E element)
}
interface MutableCollection<E> extends Collection<E>
{
@Overri...
Begird asked 31/1, 2016 at 14:39
2
Solved
I'm reading SCJP by katherine sierra.
I understand that abstract and final keywords cannot be used together because they contradict each other as explained in the book.
However, I don't understan...
Zurn asked 9/5, 2013 at 1:53
0
The implementation of abstractclassmethod abc.py in Python 3.4 looks like this:
class abstractclassmethod(classmethod):
__isabstractmethod__ = True
def __init__(self, callable):
callable.__is...
Marchpast asked 2/5, 2015 at 21:15
5
Solved
Why is new/override required on abstract methods but not on virtual methods?
Sample 1:
abstract class ShapesClass
{
abstract public int Area(); // abstract!
}
class Square : ShapesClass
{
int ...
Nagpur asked 3/9, 2010 at 9:37
3
Why do we need abstract classes in Java? If you're never going to make it into an object, why have it in the first place? How do you use it? Why is it there?
I'm wondering the same thing with...
Ternary asked 28/2, 2014 at 4:8
7
Solved
I am new to Java (reading books for 4 months now). So probably my question can appear too simple. My understanding is that abstract methods don't have a body and can't provide implementation
So ho...
Fremantle asked 7/8, 2013 at 11:21
1
Solved
I'm reading the code that package time, and then I want to know how the func After(d Duration) <-chan Time works.
I found the code follows:
func After(d Duration) <-chan Time {
return New...
Brokerage asked 18/2, 2013 at 14:47
6
Solved
I would like to know the difference between two conventions:
Creating an abstract base class with an abstract method
which will be implemented later on the derived classes.
Creating an abstract ...
Azrael asked 8/4, 2011 at 22:0
1 Next >
© 2022 - 2024 — McMap. All rights reserved.