inheritance tag

29 questions


1 answers
373 views
0
Questions about Python class inheritance!

In that code, the Professioner and Student classes are sister classes that belong to the School parent class.I wonder how I can modify the Edison of the Professor class to come out when Jane.matchProf...

1 years ago

1 answers
132 views
0
How to Create an Interface

How do I set up a class that represents the interface?Can I just write an abstract class?


2 answers
113 views
0
Why do you take virtual inheritance?

virtual base class, virtual Why is inheritance used?I want to know what it means.class Foo{public: void DoSomething() { /* ... */ }};class Bar : public virtual Foo{public: void DoSpecific() { /* ... *...

1 years ago

2 answers
92 views
0
Is there a time when you use Interface instead of an abstract class? And is there the opposite?

It's a general OOP question. I want to make a general comparison between Interface and the basic use of abstraction classes. I want to know the difference between using the interface and using the abs...


1 answers
83 views
0
How do you use super() in Python?

In Perl and Java, super() was used to call the method of the parent class.package Foo;sub frotz { return Bamf;}package Bar;@ISA = qw(Foo);sub frotz { my $str = SUPER::frotz(); return uc($str);}I don't...


1 answers
67 views
0
To override a class's variable in Java

class Dad{ protected static String me = dad; public void printMe() { System.out.println(me); }}class Son extends Dad{ protected static String me = son;}public void doIt(){ new Son().printMe();}When y...

1 years ago

2 answers
106 views
0
Multiple constructors are required for Java inheritance

I'm a self-taught student in Java. I am studying inheritance and super class nowIf a superclass can have multiple constructors, I would like to ask you how to create a subclass constructor. The code I...


1 answers
83 views
0
Why should the parent class constructor (in relation to inheritance and constructor) be performed first! I wonder if my guess is correct.

Ian Media is a student who is studying with a book called 'The first java programming'. I was studying inheritance and constructor, but the book said that in order for an explicit constructor or impli...


1 answers
121 views
0
Questions about Python __init__() and super()

I'm studying super()What is the difference between ChildA() and ChildB() in the code below?class Base(object): def __init__(self): print Base createdclass ChildA(Base): def __init__(self): Base.__in...

1 years ago

1 answers
70 views
0
Do I have to write myself to call the constructor of the parent class?

Is this the only way to call a parent class constructor in a structure where C inherits B and B inherits A?class A(object): def __init__(self): print Creator Aclass B(A): def __init__(self): super(B...

- 1 - »

© 2024 OneMinuteCode. All rights reserved.