Questions tagged [instance]

In object-oriented programming an instance is an occurrence or a copy of an object, whether currently executing or not.

Instances of a class share the same set of attributes, yet will typically differ in what those attributes contain. For example, a class "Employee" would describe the attributes common to all instances of the Employee class. For the purposes of the task being solved Employee objects may be generally alike, but vary in such attributes as "name" and "salary".

Related tags:

5388 questions
1
vote
0 answers

Mounted variables not showing in next files (Vue.js)

Hello, I have this code in my Vue3 App. main.js: import App from './App.vue'; const app = createApp({ data: () => { return { message: "Hello"; } }, render:…
TheCoder
  • 33
  • 4
1
vote
2 answers

Can the class of an object change in UML?

In short Mainstream class-based OO languages do not allow the class of an object to change after creation. I assumed the same constraint in UML, based inter alia on the following clauses in the UML 2.5 specification: 7.5.1: Types and multiplicity…
Christophe
  • 68,716
  • 7
  • 72
  • 138
1
vote
0 answers

SQL Server : fix Error 18456, Severity: 14, State: 1. Login failed for user

I'm trying to connect to my local system. But the server cannot be connected and getting the below error. Cannot connect to HSL11594. Login failed for user 'user\user'. (.Net SqlClient Data Provider) Server Name: Servername Error Number:…
usha
  • 15
  • 1
  • 5
1
vote
2 answers

Azure Container instances no IP

I created a Container Instance in Azure and used a Hello World image. However, I do not get any IP to access the webserver!
1
vote
1 answer

python new instance not updating variable

I'm trying to learn python with some data-structure. I'm trying to create a binary tree. So I've created a node like: class Node(object): def __init__(self,value,left,right): self.value = value self.left = left self.right…
Danial
  • 542
  • 2
  • 9
  • 24
1
vote
1 answer

Open an activity via intent or via instance

I have a class REG that extends Activity: it has a window, buttons, actions, etc. I know how to open the activity via an Intent. Yet, I could also make a new instance of the class: new REG(...) When/why I should use one over the other?
Luis A. Florit
  • 2,169
  • 1
  • 33
  • 58
1
vote
0 answers

How to get the instance of an Object in a runnging simulation?

I am writing a small program to control an underground garage. The program runs as a small simulation and I would like to have access to state changes of certain variables etc. while this is running. But I don't know exactly how to implement…
Hubi
  • 440
  • 1
  • 11
  • 25
1
vote
3 answers

Why does my receiver's class instance method not receive any data?

I created a basic emitter and receiver. Please can you let me know why when I console log the receivers messages it returns an empty array? class Emitter { constructor(messages = []) { this.messages = messages; this.event = () => {}; …
Matt Hammond
  • 765
  • 1
  • 7
  • 25
1
vote
1 answer

Use or access class instances directly in another class in Python

I am trying to figure out how to access a class instance in another class in Python. In the example below I create two classes, house and paint, and I want to use the dimensions from the house class as a variable in the paint class: class house: …
Matly
  • 13
  • 3
1
vote
1 answer

How many max python 24/7 request scripts i can run on gcloud tmux console

I have created a python script that has requests api to run 24/7 and i have hosted it on google cloud. The task is about getting stock price change ticks every second via a python script api. As i am newbie i am able to run that script on google…
1
vote
5 answers

EnumType foo: How do I write foo.changeme()?

Here's what I've written: public class JavaApplication4 { private RunMode runMode; private enum RunMode { STOP, START, SCE, SIE; void reset() { this = STOP; // <=== 'cannot assign a value to final variable…
Chap
  • 3,649
  • 2
  • 46
  • 84
1
vote
1 answer

Filling in properties using braces after using Factory Method

Is it possible to create a method that returns a new object, where i can still use: { variable 1 = "content1", variable2 = "content2" } Because for now after getting the object, i have use the following instead: tempObject.variable1 =…
1
vote
2 answers

How to make something happen at fixed intervals of time in a java program?

Basically, I have an int value, x, that is an instance variable of a class. It is set to 0 initially. I have another method, "getNum," that increments and returns x. This getNum() method is called by an outside program. However, each day (let's say,…
joseph
  • 767
  • 3
  • 8
  • 16
1
vote
2 answers

How to read the object name from memory?

I wrote a simple class code like below. class Fridge: def __init__(self): self.isOpened = False self.foods = [] def open(self): self.isOpened = True def put(self, thing): if self.isOpened: self.foods.append(thing) def…
code gen
  • 11
  • 2
1
vote
1 answer

How do you set an instance variable in one object from another?

I have an AppController object that contains an instance variable int adventures. This is bound to a label through Interface Builder. I also have a subclass of NSWindowController called PopUpWindow. When the enter button is clicked the value in the…
sud0
  • 537
  • 4
  • 18