what is difference between static and non-static variables
Answer Posted / mahesh_b.tech@2008
Non-static variables:
Instance block can be executed automatically when you were
creating the object.
Instance variables can be called by using with the object.
Instance variables can not called by using the class name.
memory will be alocated for instanse variables when you
create the object.
Static variables:
static block will be executed automatically when jvm(Java
Virtual Machine)loading the class into memory.
static varisble can be called using both objectname&class
name.
memory will be allocated when jvm loads the class.
| Is This Answer Correct ? | 13 Yes | 4 No |
Post New Answer View All Answers
Does c++ have arraylist?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
What is vectorial capacity?
write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;
Please explain class & object in c++?
why is c++ called oops? Explain
What is the full form of ios?
What is binary search in c++?
Can I run c program in turbo c++?
What is scope operator in c++?
What parameter does the constructor to an ofstream object take?
What is the use of object in c++?
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Write an algorithm that determines whether or not an almost complete binary tree is a heap.
Is c++ free?