Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
GeneralRe: SqlDependency. Can't realize. Pin
Eddy Vluggen1-Apr-13 11:41
professionalEddy Vluggen1-Apr-13 11:41 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer2-Apr-13 10:24
Jeka Developer2-Apr-13 10:24 
GeneralRe: SqlDependency. Can't realize. Pin
Eddy Vluggen3-Apr-13 6:52
professionalEddy Vluggen3-Apr-13 6:52 
AnswerRe: SqlDependency. Can't realize. Pin
jschell1-Apr-13 8:12
jschell1-Apr-13 8:12 
GeneralRe: SqlDependency. Can't realize. Pin
Jeka Developer2-Apr-13 10:26
Jeka Developer2-Apr-13 10:26 
QuestionSNMP Pin
Sahar.H30-Mar-13 22:05
Sahar.H30-Mar-13 22:05 
AnswerRe: SNMP Pin
Pete O'Hanlon30-Mar-13 23:09
mvePete O'Hanlon30-Mar-13 23:09 
QuestionRegarding class instance and memory allocation c# Pin
Tridip Bhattacharjee30-Mar-13 20:33
professionalTridip Bhattacharjee30-Mar-13 20:33 
C#
static void Main()
    {
        Employee e =new Employee();

    }

public class Employee
{
    static int counter=0;
    double mydata = 500;
    private string _FirstName;
    
    public string FirstName {
        get { return _FirstName; }
        set { _FirstName = value ; }
    } private string _LastName;
    
    public string LastName {
        get { return _LastName; }
        set { _LastName = value; }
    }
    
    public double CalculateValue() {

    double _local=10; mydata=mydata * _local; return mydata ;
    }

}


1) i just like to know when i will run my program then who call the static main() function

2) when employee class instance will be created then how memory will be allocated for this class?

3) where this variable will store in heap or stack ?

static int counter=0;
double mydata = 500;
private string _FirstName;

4) where _local variable will be store when calculatevalue will be called ?

5) the important things is where data is stored when we assign data to variable. in stack or heap ?

suppose i have variable called Name="Hello" or Salary=5000 where Hello & 5000 as value will be stored ? heap or stack ?

6) where static variable is stored declared in class?

7) static class load into memory when program just run even if i do not call or use them ?

i heard that memory is allocated when we create instance of non-static class. so in case of static class we can not create instance so how they load into memory. just automatically by CLR when program just invoke or when we use that static class first time ? please explian. thanks
tbhattacharjee

AnswerRe: Regarding class instance and memory allocation c# Pin
Eddy Vluggen31-Mar-13 1:12
professionalEddy Vluggen31-Mar-13 1:12 
GeneralRe: Regarding class instance and memory allocation c# Pin
Tridip Bhattacharjee1-Apr-13 4:29
professionalTridip Bhattacharjee1-Apr-13 4:29 
GeneralRe: Regarding class instance and memory allocation c# Pin
Eddy Vluggen1-Apr-13 11:49
professionalEddy Vluggen1-Apr-13 11:49 
AnswerRe: Regarding class instance and memory allocation c# Pin
PIEBALDconsult31-Mar-13 4:48
mvePIEBALDconsult31-Mar-13 4:48 
QuestionWCF file upload functionality and message contract usage Pin
Tridip Bhattacharjee30-Mar-13 19:52
professionalTridip Bhattacharjee30-Mar-13 19:52 
QuestionControl when to display something in a projector Pin
drazen1230-Mar-13 17:26
drazen1230-Mar-13 17:26 
AnswerRe: Control when to display something in a projector Pin
OriginalGriff30-Mar-13 21:56
mveOriginalGriff30-Mar-13 21:56 
QuestionNumber slider puzzle solver code c# Pin
jebreil 64429-Mar-13 19:00
jebreil 64429-Mar-13 19:00 
AnswerRe: Number slider puzzle solver code c# Pin
Kenneth Haugland29-Mar-13 21:40
mvaKenneth Haugland29-Mar-13 21:40 
GeneralRe: Number slider puzzle solver code c# Pin
harold aptroot29-Mar-13 23:17
harold aptroot29-Mar-13 23:17 
QuestionBack and Forward Button for windows explorer Pin
baharan2029-Mar-13 10:42
baharan2029-Mar-13 10:42 
AnswerRe: Back and Forward Button for windows explorer Pin
Member 982361929-Mar-13 10:50
Member 982361929-Mar-13 10:50 
GeneralRe: Back and Forward Button for windows explorer Pin
baharan2029-Mar-13 11:14
baharan2029-Mar-13 11:14 
AnswerRe: Back and Forward Button for windows explorer Pin
Eddy Vluggen31-Mar-13 1:15
professionalEddy Vluggen31-Mar-13 1:15 
QuestionOSPF in the WSN Pin
traidat199229-Mar-13 7:11
traidat199229-Mar-13 7:11 
AnswerRe: OSPF in the WSN Pin
Pete O'Hanlon29-Mar-13 8:25
mvePete O'Hanlon29-Mar-13 8:25 
QuestionHELPPPP Pin
ali69929-Mar-13 4:43
ali69929-Mar-13 4:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.