Category "class"

Outer class can't create an object of my inner class [duplicate]

I am so confused. I have a nested class where Book is the inner and Bookshelf is the outer class. When I try to create a Book object in my Boo

Take a class as a parameter which has a particular method in it

I know that we can pass a class in a param which has a particular class as its super. For example, see this: public void sampleMethod(Class<? super MyParentC

Base Class extended Incorrectly

Hey I am using Deno and extending EventTarget class but I don't want the end user to be able to get functions which exist on EventTarget class like addEventList

Property initializers run before 'self' is available

Seems like I'm having a problem with something that shouldn't be the case... But I would like to ask for some help. There are some explanations here on the Stac

How to assign a database model to a user

from django.db import models from datetime import datetime from django.contrib.auth.models import User class News(models.Model): user

Why is my linked list size function not working as intended?

I used the following code to define my linked list, nodes and a few functions. class node: def __init__(self,node_data): self.__data=node_data

Custom utility types (generic types) for classes `IsClass` of TypeScript

I am trying to create a generic type to make sure the first parameter to be a class. However, the factory function parameter cannot be replaced by a generic typ

Are there any Java Class Library "header files" containing all method descriptors in the standard library?

In order to create a valid .class file, every method has to have a full internal name and type descriptors associated with it. When procedurally creating these,

i am using a small php microframework and keep getting an error Uncaught Error: Undefined constant "mu"

Fatal error: Uncaught Error: Undefined constant "mu" in E:\xampp\htdocs[[myphpframework]]\mu-clean\examples\hello1.php:3 Stack trace: #0 {main} thrown in E:\xam

Using different instance of self as argument to method in python

I'm trying to create a method that takes self and another instance of the same method as its arguments, for example: class AClass(): def __init__(self

/Main.java:17: error: non-static variable this cannot be referenced from a static context ^ 1 error [duplicate]

In this simple code can anyone explain me what's wrong ? public class Main { public class UserValidator { public void validateName(String

VBA: Creating a class property that is an array of dictionaries

In Microsoft Excel VBA I need to create a class that has two properties, "Name" and "Holdings". "Name" is just a string so the code for that is easy. But I ne

python workaround gpiozero when_motion with multiple sensors

i'm trying to listen on 3 motion sensors, each one triggering its own sound i'm using when_motion because it's creating a thread, so i can do other thing while

How do I make this function more efficient?

I'm trying to create a tiny database that contains a list of people, their names, ID, and their income as time passed on. Using this database I'd like to find t

Pythonic way to control an attribute over another attribute

There is a pythonic way to control attributes? I wan't that the init method is clear, trying to avoid to use a function like: self.a = check_a_greater_than_b(a)

VBA UserForm Frame ScrollTop function not working from class function

This should be a simple task and I've been coding in VBA for 10+ years but I cannot seem to get this to work. I have a UserForm with a MultiPage (with 2 pages)

Still can't use a function defined in a separate .cpp file

I've been searching through questions on this for hours, and it just isn't working for some reason, so sorry if there's already an answer and I just didn't unde

Friend classes and header files

I am writing a C++ program where I wish to use a friend class in order to access protected members of another class. Here is the header for the class I wish to

Flutter and audioplayer: cannot stop playing audio between 2 classes

**Hello, I am new to Flutter, I hope you will be able to understand my problem. I am using “AudioPlayers” and would like to play audio from a define

how to handle garbage value while making my own vector in c++?

Good evening guys I am trying to make my own vector class. But I have few problems. Firstable, I dont know why There is garbage value I've tried to check constr