An instance is a specific realization of any object.
Questions tagged [instances]
516 questions
-2
votes
2 answers
Access class instance that is initialised in action event java
I am trying to have one class read a variable belonging to one instance of another class. The class that is being read from is only initiated once a JButton is pressed. From my experimenting it seems that I am unable to access any of the class's…

user3256725
- 93
- 8
-3
votes
1 answer
C++ dereferencing an instance
I'm new to C++ and I'm trying to dry up my code, for example:
void gethit () {
Gert.hitbox(AA.x, AA.damage);
Gert.hitbox(AB.x, AB.damage);
Gert.hitbox(AC.x, AC.damage);
Gert.hitbox(AD.x, AD.damage);
Gert.hitbox(Terbil.x,…

Garrett Hale
- 21
- 7
-4
votes
1 answer
create new instances for tables in mySQL
So I might be thinking of this the wrong way but I have a database with tables that are somewhat dependent on one another. In Java you can create new instances of the same class in order to do different things. Is there something to this effect in…

gemini88mill
- 170
- 2
- 11
-4
votes
4 answers
Why does == work on integers but not on strings?
I know this:
When you use == to compare two objects it will compare the two instances of the object and check if they are the equal.
When you use .equals() it will compare the states of the 2 objects.
Let's say this is my code:
String string1 =…

Thomas Vanhelden
- 13
- 3
-4
votes
2 answers
Declaring an Instance of a Subclass
I created a class called bank and its subclass called ATM and I wish to declare an instance of the subclass ATM. When i declare it as shown below it gives me an error.
package bank;
import java.util.Scanner;
public class Bank {// Bank class
…

noname
- 1
- 1
- 1
-6
votes
2 answers
Storing class instances in a file
I'm attempting to make an RPG using c++, for now just a text RPG. I'm wanting to create lots of instances of the class "monster". Lets say I need to make 100 monsters(goblins, ogres, dragon, etc.), how should I store these? Should I have a separate…

Joe
- 3
- 2