What is stack and heap?
Answers were Sorted based on User's Feedback
Answer / sharif
Stack memory is maintain the value types
heap meamory is maintain the reference type
| Is This Answer Correct ? | 21 Yes | 0 No |
Answer / jaikumar.c
Stack is memory to store objects in Ram memory.
Heap is kernal alloted memory to store objects
| Is This Answer Correct ? | 13 Yes | 7 No |
Answer / maria
I think stack is a memory that is used to store actual
values of an object whereas Heap is a memory that is used
to store references of the objects. Iam student of IUB
bahawalnagar campus. I hope you will give opinion on it.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / pushparaj pentakota(anakapalli
stack can store value type and reference type also but at compile time only but heap can store objects at run-time.stack can't store objects bcz stack at run-time can't increse their memory size it's fixed length.objects need extra memory sometimes so objects allocate memory in heap context.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / maria
I think Stack is memory location that is for storing real
object values wheres Heap is used to store just reference
of objects. I am student of IUB bahawalnagar campus. Are
you agree with my
thought.
Thanks
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / kannan.s
When a program is loaded into memory, it is organized into
three areas of memory, called segments: the text segment,
stack segment, and heap segment. The text segment
(sometimes also called the code segment) is where the
compiled code of the program itself resides. This is the
machine language representation of the program steps to be
carried out, including all functions making up the program,
both user defined and system.
The remaining two areas of system memory is where storage
may be allocated by the compiler for data storage. The
stack is where memory is allocated for automatic variables
within functions. A stack is a Last In First Out (LIFO)
storage device where new storage is allocated and
deallocated at only one ``end'', called the Top of the
stack.
| Is This Answer Correct ? | 5 Yes | 5 No |
Answer / vijay rana
stack is used for store value types;
heap is used for store reference type values;
| Is This Answer Correct ? | 9 Yes | 9 No |
what is the need of using interface in program ex:if we have a program like this interface1() { void method1(); void method(); } class a1 : interface1 { a1 b = new b(); b.method1(); b.method2(); } so without using interface also we can achieve this then wat is the need to use the interface? plz give me the answer
Define multicast delegate in c#?
How you will connect to windows directory in c#?
2 Answers HP, nTech Solutions,
How do I make a dll in c#?
What is datetime minvalue in c#?
Is null empty or whitespace c#?
Explain synchronous and asynchronous operations?
Why do we use methods in c#?
what is dynamic sql
Differentiate between static class and singleton instance?
What is the implicit name of the parameter that gets passed into the class set method?
Explain how do you convert a value-type to a reference-type?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)