Questions tagged [instances]

An instance is a specific realization of any object.

516 questions
-1
votes
2 answers

How can I access non-static methods for instances of objects stored inside of an array?

I'm creating a simulation for one of my classes and I'm running into some trouble. Looking for some direction here + any tips. I have two classes so far and I'm looking to implement some other things. At the moment, I want to be able to access the…
mmuso
  • 11
  • 3
-1
votes
1 answer

Can a group of instances be created with one already created instance?

I have in google cloud one instance created and in production. The instance is for one online store made with wordpress/woocommerce. I'm thinking in create a CDN and use Load Balancer. My question is, can I use that instance and create clones of…
nam_10
  • 1
  • 1
-1
votes
1 answer

How to overwrite an existing dictionary Python 3

Sorry if this is worded badly, I hope you can understand/edit my question to make it easier to understand. Ive been using python pickle to pickle/unpickle the state of the objects in a game (i do understand this is probably very storage/just…
user4548084
-1
votes
1 answer

WinForms Multi-Instance Forms with unique variables

New to C#; have been a VB.NET/VBA developer for years. Am currently working on an application for our off-site workers. I have a main switchboard form with a drop-down of project numbers. The user then has the ability to open a variety of form-based…
-1
votes
1 answer

access mysql on t2.micro from another t2 micro instance

I have installed mysql 5X in one t2.micro instance. And Installed hadoop in another t2.micro instance. When i tried to connect to mysql from hadoop its saying connection failure. I am able to ssh between systems. How to make communications possible…
-1
votes
1 answer

I'm having difficulty accessing this class -- "error: non-static variable this cannot be referenced from a static context"

I'm creating a program that is supposed to create a memorization game that assigns colors to a user, and then tests how well the user can relay the colors back. Because of this, I created an array class that has two arrays (one with colors already…
Kody_06
  • 163
  • 2
  • 9
-1
votes
1 answer

Javascript basic instanciation

I am a javascript newbie who's trying to transition from processing to javascript. Using Paper.js, I am simply trying to understand the equivalent of classes and their functions with the code below but keep having this error : Cannot read property…
-1
votes
2 answers

attribute has no self (but it is not a class attribute either)

I'm new to python and I've been trying to understand classes. As far as I know, when you create a class, you must insert self before a variable, so that self is replaced by the instances, when they're created (these become instance…
Acla
  • 141
  • 3
  • 12
-1
votes
3 answers

Can't create multiple instances of a class in Java

I'm trying to create multiple characters(squares) on the screen that move around randomly. I have already created a CharMove class that creates a square, and moves it around randomly on the screen. However, I tried creating multiple instances of…
Ninjaman494
  • 180
  • 3
  • 10
-1
votes
1 answer

PHP: Error in creating Server Instance in Google Cloud Compute

While using Google Cloud Compute's API in PHP, I am able to start, stop, delete instances as well as create and delete disks. However, when trying to create an Instance, I keep getting this error Invalid value for field 'resource.disks' PHP Fatal…
-1
votes
1 answer

Android Find ListView instance which is created by Class in View Pager

I have to create one reporting application, in which sane report format, adapter is used to generate reports layouts dynamically in view pager adapter. switch (index) { case 0: return new sfg(); case 1: return new…
-1
votes
1 answer

Can anyone help me with how to use interfaces?

It is for a Minecraft plugin (though it's just to try to figure out how they work); thus, it's only for practice, in a sense. I can't figure out how to use the instance Explosive of the class Explosive of the package net.canarymod.api.entity. Any…
-1
votes
1 answer

Understanding inheritance in practice. Printing values of an instance

I have a class of Agents with a working __str__ method. I have a class of Family(Agents). The Family is structured as a dictionary with the Agent ID as key. After allocating agents to families, I iterate over my_families: When I print…
B Furtado
  • 1,488
  • 3
  • 20
  • 34
-1
votes
2 answers

Error: Source not found. The classes I have are build with the help of inheritance

I am new to JAVA and this is my first attempt with inheritance. When I try to debug the below codes, I get the error: Source not found. I have no idea how to fix this. I created all of them under the same package. If you guys need me to post more…
-1
votes
2 answers

trouble writing a static version of the add and subtract methods (this is in java)

I need help writing a static version of the add and subtract methods. i have tried to do so but im not really sure if this is the right way and also my equals method is not working . When i compile my equals method it always prints false. public…