Hi guys.
I have a problem when using Jython, but I can't seem to find a solution in the documentation.
Basically what I have is an object that has been instantiated in Java, and I want to instantiate another Java object (in the python script) and have the pre-instatiated java object added to the object I have instantiated in the jython...
If I use multiple instances of the same object in my code, do the instance methods for each separate object require memory, or do all of those objects share the same instance methods?
It could have a big effect on memory use.
Thanks in advance for any insights.
John Doner
...
Is there a function I can use to instantiate an object with arguments?
#include <database.h>
class database
{
function __construct($dbhost, $user, $pass, $etc) { /* etc */ }
function query($sql) { /* dowork*/ }
}
$args = array('localhost', 'user', 'pass', 'etc');
$db = create_object('database', $args); // is there a function li...
I'm setting out to create an app where it will use 7-10 instances of a custom class, lets call them "books" each class will consist of a number of pages, a title, a int of how many pages a book contains and possibly some notes of the author associated with a specific page.
My question is what is the best way of creating these objects. i...
I'm battling with this assignment :)
I've got two classes: Ocean and Grid.
When I declare an object of the Grid inside the Ocean:
unsigned int sharkCount;
Grid grid;
The compiler/complainer says:
error C2146: syntax error : missing ';' before identifier 'grid'
Can you possibly predict what produces this error with the limited i...
Do Android have any way to instantiate objects without calling any of its constructors?
In Java, Sun have sun.reflect.ReflectionFactory.getReflectionFactory().newConstructorForSerialization(), in .Net we have System.Runtime.Serialization.FormatterServices.GetUninitializedObject() but I was not able to find anything like that in the And...
hey. Is it possible to have a method that allows the user to pass in a parameter of a certain type and have the method instantiate a new object of that type? I would like to do something like this: (I don't know if generics is the way to go, but gave it a shot)
public void LoadData<T>(T, string id, string value) where T : new()
...