abstract Questions
2
Solved
If the base class and derived class both have their constructors with parameters then where we pass the parameters to the base class constructors?
Proudfoot asked 5/5, 2014 at 20:40
15
Solved
Data classes seem to be the replacement to the old-fashioned POJOs in Java. It is quite expectable that these classes would allow for inheritance, but I can see no convenient way to extend a data c...
Superannuate asked 18/10, 2014 at 20:18
3
Solved
Just to be sure, has Dart removed explicitly defining an interface now in favor of implicitly defining it via abstract?
I see it mentioned in Dart and Interface Segregation Principle, however I...
Groat asked 18/2, 2015 at 22:52
3
I had an issue with a solidity contract in which the error demanded I write my code as an abstract. Abstract means my code will be non-deployable.
This is a contract that aims to transfer assets an...
Holocaine asked 31/5, 2023 at 8:23
7
Solved
This is a quoted question from the study materials from my university.
It makes totally no sense to me.
For me hooks are specified points in (mostly sequential but not only) programs, where you c...
4
Solved
I have an abstract base controller which has a constructor I hoped would be populated by autofac when the controllers were built.
public abstract class BaseController : Controller
{
protected ILog...
Fuse asked 26/8, 2011 at 1:20
7
Solved
I have an abstract class A that define abstract methods. This means that, for a class to be instanciable, all the abstract method have to be implemented.
I'd like all my subclasses to implement a ...
Plenum asked 2/7, 2010 at 8:55
18
Is it possible to simulate abstract base class in JavaScript? What is the most elegant way to do it?
Say, I want to do something like:
var cat = new Animal('cat');
var dog = new Animal('dog');
cat...
Benediction asked 28/2, 2009 at 9:6
2
Solved
How do you make an abstract property in python?
import abc
class MyClass(abc.ABC):
@abc.abstractmethod
@property
def foo(self):
pass
results in the error AttributeError: attribute '__isabstrac...
Longlegged asked 23/6, 2022 at 21:28
3
I guess this question is geared more towards the language-geeks.
I have the following class:
<?php
abstract class ScopeFactory
{
public static function doStuff()
{
}
}
Now, I'm able to c...
8
Solved
What's the best practice to define an abstract instance attribute, but not as a property?
I would like to write something like:
class AbstractFoo(metaclass=ABCMeta):
@property
@abstractmethod
...
6
Solved
I am new to Go and I'm wondering how I can implement a structure similar to abstract classes & methods in Java. In Java, I'd do the following:
abstract class A{
static method1(){
...
metho...
Rivarivage asked 15/6, 2014 at 18:1
7
Solved
I am not asking this -> Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?
In Java, multiple inheritance isn't allowed, but, after Java 8, Interfaces ca...
Darvon asked 3/10, 2018 at 6:29
1
Solved
I wonder if I found the right solution how to access static property/method of the interface when the interface is implemented explicitly.
In .NET 7 interface can define static abstract members. Fo...
5
Are there are differences between hashmap and hashtable in theory?
I don't mean in the concrete definitions given in Java (or the implementation), but in theory. Isn't a hashtable a map that uses ...
Magus asked 7/5, 2015 at 19:41
13
Solved
How can I make a class or method abstract in Python?
I tried redefining __new__() like so:
class F:
def __new__(cls):
raise Exception("Unable to create an instance of abstract class %s"...
Bullheaded asked 30/11, 2012 at 13:29
9
Solved
Recently I started exploring Java 8 and I can't quite understand the concept of "functional interface" that is essential to Java's implementation of lambda expressions. There is a pretty comprehens...
Colpotomy asked 1/2, 2013 at 22:12
2
Solved
I want to do something like this:
interface Serializable<FromType, ToType> {
fun serialize(): ToType
companion object {
abstract fun deserialize(serialized: ToType): FromType
}
}
or ev...
Remake asked 2/11, 2016 at 0:2
2
Solved
I have a persistence model like this one :
@Entity
public abstract class Employee {
@Id
protected Integer employeeId;
...
}
@Entity
public class FullTimeEmployee extends Employee {
protected I...
Matronage asked 5/8, 2013 at 7:51
3
Solved
Let's say I have common logic that depends intimately on data members as well as a piece of abstract logic. How can I write this in rust types without rewriting the same code for each implementatio...
5
Solved
I have a base abstract class in which I have defined a virtual abstract function.
TMyBaseClass = class abstract(TForm)
public
function MyFunction : string; virtual; abstract;
end;
I have notice...
Tranquillity asked 22/8, 2016 at 9:25
3
Solved
I'm having some trouble implementing pure virtual functions inherited from some abstract class, when the classes in question are divided into *.h and *.cpp files. The compiler (g++) tells me that t...
Crutchfield asked 13/1, 2011 at 0:29
13
Solved
I am coming from c# where this was easy, and possible.
I have this code:
public abstract class clsAbstractTable {
public abstract String TAG;
public abstract void init();
}
but Eclipse tell...
4
Solved
Hi I have an abstract class in which I have some public methods and some abstract ones.
I have the public so that they implement the common methods for the derived classes.
What is confusing me is...
6
Solved
In Java, I can't create instances of abstract classes. So why doesn't eclipse scream about the following code?
public abstract class FooType {
private final int myvar;
public FooType() {
myvar...
Prothonotary asked 2/7, 2011 at 15:14
1 Next >
© 2022 - 2025 — McMap. All rights reserved.