Identical classes casting?
Suppose I have two classes A and B. Both are identical (same atributes, methods, etc), but they are named different. There's some safe way, in Java, to cast a B object as an A object? ...
Suppose I have two classes A and B. Both are identical (same atributes, methods, etc), but they are named different. There's some safe way, in Java, to cast a B object as an A object? ...
Okay, I'm over my head and fumbling in the dark here. I'm trying to modify a class to crop an image by setting the height, width and starting x & y positions. The class I'm using handles everything but the starting x & y, and try as I might all I can do is blow it up. Can someone help me with this?? the relevant function is listed be...
Take this code: struct mystruct { int var; mystruct() : var(0) {} }; int main() { mystruct ins; int* p = &ins.var; *p = 1; } So what are some concrete really good examples of uses for the class member pointer? int X::*p = &X::data; /* p contains offset */ X object; X *objptr = new X; int i = o...
What is the purpose of base() in the following code? class mytextbox : TextBox { public mytextbox() : base() { this.Text = "stack"; } } ...
class xyz{ ... ... }; while(i<n){ xyz ob; ... ... } Do I need to destroy the earlier object before reallocating memory to it? ...
I know that PHP5 will let you iterate through a class's properties. However, if the class extends another class, then it will include all of those properties declared in the parent class as well. That's fine and all, no complaints. However, I always understood SELF as a pointer to the current class, while $this also points to the curr...
Possible Duplicate: Empty class in C++ class Class1 { char c; }; class Class2 { }; What is the size of Class1 and Class2? In VC6, I got both 1. can someone explain this? ...
Hi I need some help to download a file from my java application. The URL is "http://my.site.com/UICFEWebroot/QueryOneDateAllCur?lang=ita&rate=0&initDay=11&initMonth=10&initYear=2010&refCur=euro&R1=csv" I try using this code but the result is an empty file URL urlAgg = new URL(address); int lf = urlAgg.openCo...
How would this code be different if the method was in a different class? [saveButton addTarget:self action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside]; ...
I have created a custom class for my Android project called "Sounds" I want to be able to call it from my activity. The contents of my class are as follows: package com.mypackage; import java.util.HashMap; import android.content.Context; import android.media.SoundPool; public class Sounds { private static boolean sound = true; priv...
I'm new to python and I'm not sure how to pass data between objects. Below is a tabbed program using python and wxwidgets. How would I be able to access the maintxt instance from the GetText method since their in different classes? Thanks. ........ #!/usr/bin/env python import wx class PageText(wx.Panel): def __init__(self, pare...
Hi, I have 82 procedures that create data tables, and i want to iterate through this tables and dynamically create the following classes for each data table: * The data table contain two columns: Id, Desc. e.g. CountryId, CountryDesc. * Each of the bold items in the example class below is dynamically create based on the data table i am u...
I'm developing an Android project , the main activity well call a method(Ptime.GetDate) which will change a global variable (output) then this activity will print this variable public class calendar extends main_menu { int i=0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle sav...
Hi Team! Can anybody tell about the "asynctask" used in android application. Currently I am working on an application where I have to create a Class in which I have to just get the response of any particular URL given. I this particular class I was told to perform this task by making use of "asynctask". I had been getting very quick r...
Hi folks, I need to dynamically create a class. To go in futher detail I need to dynamically create a subclass of Django's Form class. By dynamically I intend to create a class based on configuration provided by a user. e.g. I want a class named CommentForm which should subclass the Form class The class should have a list o...
Hi, this one has been puzzling me for a few days now and I feel that I have barely been able to narrow it down. I am using Java and have a wizard for the user to step through. One of the steps allows the user to select a start time & date and an end time & date to schedule some work. I thought I had the validation on the dates complete...
I have a menu and each menu item is a span with a class set in css: .newClass {color: red} .oldClass {color:black} oldClass:hover {color:blue;} When you click on a menu item the class is changed with: $(this).removeClass('oldClass').addClass('newClass'); which works fine. When another menuItem is click I change the classes back o...
Hi All! I am new to Java and I referred regarding my question on the Net but not quite Satisfied. I want to know what the "Utility Class" in Java is? Can anybody please tell me with an Example. Thanks, david ...
hi all, i want to create a user defined config file,which contains some variables with constant values, now i want to access those values in many pages of my application.how can use those variables using functions..what is the best way to do this without using classes. ...
Hello Folks, Could someone please explain the behavior of this class testCompile { /* * Sample Code For Purpose of Illustration */ struct person { public int age; public string name; } static void Main(string[] args) { List<person> L...