Questions tagged [instances]

An instance is a specific realization of any object.

516 questions
0
votes
1 answer

Factory Pattern: typedef Class *(createClassFunction)(void)

What does typedef Class *(createClassFunction)(void) (or another variation is typedef Class* (__stdcall *CreateClassFunction)(void))stand for? What does it mean? How am I supposed to explain it? Especially in the context of Factory Patterns...
0
votes
3 answers

How to set the text of an instantiated label?

I am teaching my self java(fx) in order to create some applications for my small business. However I am stuck with the problem below. The actual program is much larger and complicated so I created a new, smaller and easier on the eye class to get…
RAG7
  • 13
  • 7
0
votes
1 answer

Do access modifiers always have to be instantiated?

I've read the msdn.microsoft guides, a example of an acessor is the following: // public class: public class Tricycle { // protected method: protected void Pedal() { } // private field: private int wheels = 3; // protected…
César Amorim
  • 367
  • 3
  • 16
0
votes
0 answers

AS3 top down view game sound delay lagging latency on new level load

For class I had to make an as3 top down view game. Everything seems to work fine in level1 but there is a sound delay on level2. When the character collides with the hand in level2 and the sound object is called to play, the sound does not play…
0
votes
2 answers

Creating multiple instances in libgdx Box2d

I create an object in box2d, lets say a square and I want to make many copies of square with different coordinates so I can call it with Square square = new Square(int x, int y) Inside square I created a method that changes the square color. What…
Mark
  • 29
  • 3
0
votes
2 answers

Static Collection of Instances C++?

I have a class Phone, I want it, when created to add itself to a static collection of phones. So I have the collection: static vector < class Phone* > instances; And in the constructor I do this: Phone::instances.push_back(this); But the linker…
0
votes
5 answers

Java: how to create instances of two different classes in a third class and pass references to each other through the constructors

This is more of a theoretical question. Suppose I have 3 classes A, B and C. What I want to do is this: public class A { B b = new B(c); C c = new C(b); } public class B { public B(C c) { } } public class C { public C(B b) { } } I…
0
votes
1 answer

How can I refer to a parent from a child?

The wording of the title probably needs re-visiting, but for now consider the following code: var ParentControl = function() { this.ShowAlert = function() { alert('hi!'); } this.childControl = new ChildControl(); }; var…
user1017882
0
votes
0 answers

SQL Server Login Error when connecting to server with multiple instances

I have a new dedicated SQL Server with 3 different instances installed. SQL Server 2008 STANDARD SQL Server 2008 EXPRESS R2 SQL Server 2012 EXPRESS I am able to bring up all three in SSMS and can attach databases etc no problems. I am able to…
Craig Edmonds
  • 2,052
  • 3
  • 14
  • 13
0
votes
1 answer

Dynamically add Multiple Instances of a Form Based on User Input - Flex

I'm trying to create a form that based on the users input would determine how many forms to generate dynamically. I have a base state with a combo box that contains 1-4. Bases on the users selection I would like to have the next state generate the…
Adam
  • 2,632
  • 8
  • 34
  • 60
0
votes
1 answer

Can a static variable be updated by calling a method from another class in this circumstance? Java

Say, my Store class has this information... public class Store { private Product product1, product2, product3; private static int productCount = 0; public Store() { product1 = new Product(); product2 = new Product(); …
0
votes
2 answers

as3 Trouble manipulating objects outside the Document class

Im new to actionscript and I have have been mucking around trying to create a sidescrolling game. All was going well until I realized I need a game over feature. The problem is I have many movieclip objects with their own instance names that I…
Andrew
  • 189
  • 1
  • 7
0
votes
3 answers

Output class instance variables

So I am learning how instances work and how to set them and such and I am wondering if I can output the variables of an instance without to output them separately. Ex// class Program { static void Main(string[] args) { Person Ryan =…
rguarascia.ts
  • 694
  • 7
  • 19
0
votes
1 answer

Instances calling method seem to reference same list

I am working through Cravens pygame tutorial and need some clarification. Here is the code that is causing the issue: CODE1: import pygame import random # Define some colors BLACK = ( 0, 0, 0) WHITE = ( 255, 255, 255) GREEN = ( 0, 255, 0) RED = (…
Tun
  • 19
  • 6
0
votes
3 answers

Accessing Vector from another class

I have these two classes, named Student and Subject import java.util.Vector; public class Student { int registrationNumber; String firstName; String familyName; Vector sub; public Student(int registrationNumber,String…
user3029345