473,657 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redeclare an array;what happens to its objects?

hi,

i want to know what happens to objects in an array if i redeclare the
array..
look at the following code:

////my code

public MyClass[] myarray=new MyClass[ somevalue ];

for( int counter = 0 ; counter < somevalue ; counter++ )
myarray[counter]=new MyClass();

///somewhere elese
myarray=new MyClass[ some_new_value ]
////end of code
in this case what will happen to my old intances of MyClass?did they
destroy when i redeclare myarray with some_new_value?

thanks in advance.
behzad

Apr 8 '06 #1
1 3243
"Behzad" <Se*********@gm ail.com> a écrit dans le message de news:
11************* ********@g10g20 00...legro ups.com...

| i want to know what happens to objects in an array if i redeclare the
| array..

If there are no other references to the contained objects, then they will be
GCed.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Apr 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2445
by: M.Siler | last post by:
<HTML> <HEAD> <TITLE></TITLE> <SCRIPT> <!-- var factor_val = new Array(8,7) factor_val = 68.8 factor_val = 55
6
4962
by: Kutty Banerjee | last post by:
Hi, MyClass *myclass_=new MyClass; and MyClass::MyClass(int) and no default constructor. My object assignment obviously gives an error. So waht is the correct way to do it without using vectors of course. kutty
2
2034
by: Raphael Iloh | last post by:
Hi all, I'm having problems comparing array objects. Take a look at this: int array1 = new int{1}; int array2 = new int{1}; Console.Writeln(array1.Equals(array2)); One would expect the above expression to return true as both arrays are identically the same but it keeps returning false. Any info on how to solve this problem will be appreciated.
3
4402
by: Frank | last post by:
C#: cubearray?? int cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}}; How do I interpret the above array statement? regards, Frank
1
1206
by: Leszek | last post by:
Hi. I'm using <pre><?php print_r($_POST); ?> </pre> and i'm getting this: Array (
7
1910
by: kulpojke | last post by:
I am trying to map a function to the contents of an array using the map() function. However, whenever the following function is called an error message is returned complaining that: ... line 121, in b_maker b = map(function,b) TypeError: 'matrix' object is not callable This is on a windows32 system, using python 2.5 with the numpy library. In the following code data is a nested list of type float, target is a list of type float...
4
3821
Ispep
by: Ispep | last post by:
Hi, unfortunately having a bit of difficulty with a question from an Open University course I'm currently doing. If you could help me out in any way I'd be grafeul (though obviously it goes without saying I'm not asking you to solve the question - that won't help come exam time :(). Anyway I have a CSV delimited file in the following format; STRING,INT STRING,INT,INT,INT,INT,INT STRING,INT,INT,INT,INT,INT STRING,INT,INT,INT,INT,INT ...
13
2593
by: milk242 | last post by:
I know I'm making a mistake, but I'm wondering if someone could tell me the type of mistake I'm making. I know I can write the whole array to a file, but I want to create separate binary files for each Customer. Then I want to readout the binary file... either one or all of them. Could someone help me? Thanks. Customer oneArray = new Customer; oneArray = new Customer("John", "email@gmail.com", "123-345-1234", "1, 2"); oneArray =...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.