Questions tagged [super]
super is a keyword or function used to access/invoke members and constructors of a superclass. Since different languages have such a feature, please use in combination with a language tag.
super
1,774
questions
0
votes
1
answer
20
views
Overriding toga.Button using super()
I'm a newbie in Python and to learn more about OOP I want to create a new button class based on toga.Button. I used the example on the Toga website (https://toga.readthedocs.io/en/stable/tutorial/...
-1
votes
2
answers
63
views
Warning try-with-resources for closing super OutputStream
The bottom code compiles an input String and returns the result, as an int here. Although it works, I get a Netbeans warning telling me that the super.close() line in the close() method of the ...
0
votes
1
answer
43
views
inherit constructor and factory in flutter
I'm learning flutter and I'm trying to turn requests results into more convenient objects, so I created the basic schema of a response (which is not supposed to be instantiated anytime) :
class ...
0
votes
1
answer
37
views
What's the point of super.init in a Python class definition referring back to the class that is being defined?
The example below was taken from a textbook on deep learning:
class BERTEncoder(nn.Module):
"""BERT encoder."""
def __init__(self, vocab_size, num_hiddens, ...
0
votes
1
answer
58
views
querying SUPER data type value in REDSHIFT
I have SUPER datatype column in REDSHIFT table "table_1" and column name "column_1" with below value:-
{
"exp_1": "Dynamic-Control",
"exp_2": "...
0
votes
2
answers
93
views
Why does this statement after super keyword not get invoked?
Why does the line
System.out.println("GoldenDelicious non-arg constructor");
not get invoked in this code?
public class Test {
public static void main(String[] args) {
Apple a = new ...
-1
votes
1
answer
82
views
Does the default constructor of object class in java also have super() method? [duplicate]
I just found out that every class in java by default extends Object class. Meaning, that Object class is the parent class of all the classes in java by default.
Every class in java has a default ...
-1
votes
1
answer
42
views
Need to set attribute before calling super
I'm creating a custom exception to parse a specific file format. The base class is FileFormatException (I've replaced the name of the file format with FileFormat). It has a constructor public ...
-2
votes
3
answers
85
views
How to correctly implement a 'Child' class that extends a 'Parent' class and inherits a class field from the latter?
This is my task
Implement a Child class that extends the Parent.
Add a constructor to the Child class can calls super().
Implement a new function addNewAbilities(newAbility) in the Child class where ...
1
vote
0
answers
52
views
Using java super and exends with lambda expressions [duplicate]
I am fairly new to Java, currently learning about lambda expressions.
so I wanted to use generic with the Consumer function to make it accept any type of parameter passed to it and just print it out
...
-1
votes
1
answer
70
views
Why is assigning a value to super in the constructor in the ES6 standard? It is assigning a value to an instance of the class
class A {
constructor() {
this.x = 1;
}
}
class B extends A {
constructor() {
super();
this.x = 2;
super.x = 3;
console.log(super.x); // undefined
console.log(this.x); // ...
-1
votes
2
answers
65
views
How to invoke overriden method of super class from static method of child class in java
Overridden methods of super class can be accessed from a child class using the keyword super but the child class method that is invoking the super class method must be non-static. How can I invoke ...
0
votes
1
answer
56
views
How to make method of subclass inherited from pathlib.Path return Path instead of the subclass
Let's say I have defined a subclass inherited from Path, and I want to use methods from Path. For example, Path.glob() here:
from pathlib import Path
class PhotoDir(Path):
pass
# some custom ...
0
votes
0
answers
62
views
extract an array list stored in a super column in redshift table
I have a redshift table with a column of super object data type. it contains array list values such as this :
"[["SN", "Month", "1st", "5th", "10th&...
0
votes
0
answers
86
views
Python - Odoo: model inheritance via super and overridden method
As usual in Odoo, i wanted to override a method (get_login_domain) of the res.users model (defined in the addons/base), that is already overridden in another inherited model (defined in the addons/...