Questions tagged [objectinstantiation]
92 questions
0
votes
1 answer
How to access parent's class property if the current class has been instantiated in the parent
I'm experimenting with MVC trying to make a simple framework. This is an example of what I'm doing:

enzo
- 624
- 6
- 12
0
votes
0 answers
ie new object - Object doesn't support this action
Get an error in IE(all). Every other browser handles it fine.
Object doesn't support this action
var process = new $.ProcessingModal({ message: "Saving...", wait: 1000 });
process.open();
basic function setup
$.ProcessingModal = function (options)…

Yogurt The Wise
- 4,379
- 4
- 34
- 42
0
votes
4 answers
What does (TextView) (Button) do?
This should be an easy question for someone who knows how it works.
TextView myText = (TextView) findViewById(R.id.myText);
Button btn = (Button) findViewById(R.id.button);
What does the (Textview)/(Button) do, what is it?
Is it equivalent…

problemo
- 629
- 4
- 13
0
votes
4 answers
Where/How to instaniate an object to handle null reference exception
Hey guys kind of a simple question, I'm not exactly sure where/how to initialize a new object instance so I don't get this error. I have a class object(Contact) that has another class object(ContactInfo) and sometimes the user decides not to…

user2359626
- 63
- 7
0
votes
2 answers
class instantiation vs retrieval by reference
Why and when we can instantiate a class directly
Human human1 = new Human("john", "doe");
and why and when we retrieve a reference to an instance already done ?
Context.getSystemService(Context.TELEPHONY_SERVICE).

tony9099
- 4,567
- 9
- 44
- 73
0
votes
1 answer
Avoiding partial object instantiation
I'm facing a design related dilemma in my project & I'd really appreciate if I could get some suggestions. There's a POJO with around 20-25 fields & in some cases this object is partially instantiated as per the need. In my view this is not a good…

mindreader
- 1,763
- 1
- 20
- 35
0
votes
2 answers
Preserve Previous Data After Creating A New Instance Of An Object
Say I have this:
Dim Editor As frmEditor
Editor.Text = "New Form"
Editor.Controls.Add(richTextBox)
Then later in a sub routine, I do this:
Editor = New frmEditor
Is it possible to save the controls/data of the previously declared Editor for future…

Ryklon Zen
- 173
- 1
- 3
- 19
0
votes
4 answers
Reference object in java
I have gone through many links about reference object in java. Still I don't have clear idea.
superclass obj = new subclass();
How will obj get instantiated? What is the use of it?

user1526671
- 817
- 4
- 16
- 33
0
votes
1 answer
How to get JSF to auto-instantiate a session bean
This was asked in a previous question (http://stackoverflow.com/questions/6043259/auto-instantiate-a-session-bean). I implemented the solution offered by BalusC but it isn't working. This is my code:
@ManagedBean
@SessionScoped
public class…

Matthew Oakley
- 507
- 1
- 6
- 15
0
votes
1 answer
Ember.js stringtoclass
I'm searching a way to instatiate a new ember object with the classname as a string:
App.MyObject = Ember.Object.extend({hello:'hello'});
//Try to do something like this.
App.myObject = Ember.create("App.MyObject", {hello:'Hello…

claudiocro
- 83
- 1
- 5
-1
votes
1 answer
Error in instantiating an object - Too many input arguments
I created a class with the name Player. This is the code of the class
classdef Player
properties
Name
Score
end
methods
end
end
Now I use the following code to create an instance of the class. In the final…

Codacious
- 1
- 5
-1
votes
1 answer
How to instantiate SKSpriteNode spritekit swift 3
I have a 2 player space shooter game and am having trouble with the shooting part. I currently have a ship that moves it's x position with your finger. I want it to shoot strait up when the user pushes the "fire" button. So here is my question. How…

c3pNoah
- 65
- 1
- 12
-1
votes
2 answers
What `...` Do In An PHP Object Instantiation
Below is a function which we can find in core Magento 2 code.
protected function createObject($type, $args)
{
return new $type(...array_values($args));
}
This function is instantiating $type (which is a string parameter) with the arguments…

Rajeev K Tomy
- 2,206
- 1
- 18
- 35
-1
votes
1 answer
Initialization with parameters
I am following this tutorial on audio programming in C++ an theres is something I do not understand; what does the fourth line suppose to represent? I understand I am not creating an instance of AudioObject because I do not instantiate it with the…

Olivier Perrault
- 11
- 1
- 3
-1
votes
2 answers
NumberFormatException when trying to create an object in Android
I am trying to develop an app for my university project which tracks airplanes that have been picked up by an ADS-B receiver, which is connected to a server which streams the data to my app.
To do this, I've created an "Aircraft" class to keep track…

CiaranC94
- 176
- 4
- 20