What is the difference between declaration and definition?
Answer Posted / krishna chowdary garapati
Declaration means it exits but it has no meaning. But where
as definition means it has a meaning. Without decalration
there is no definition. Why means without existing how can
we use.
Some situations we do both in a single statement like,
int i = 10;
here i is declared and definie with the value 10;
But some languages give some value to the variable without
defining like
class DiffsDemo {
int i;
}
DiffsDemo demo = new DiffsDemo();
print: demo.i;
output: 0;
This will happen because some default values are assigned
to that types. Internally at run time they will define.
| Is This Answer Correct ? | 10 Yes | 5 No |
Post New Answer View All Answers
What is the example of polymorphism?
What is the importance of oop?
What is polymorphism and its types?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
to find out the minimum of two integer number of two different classes using friend function
What is variable example?
Why it is called runtime polymorphism?
How to call a non virtual function in the derived class by using base class pointer
How do you define a class in oop?
Which is not an object oriented programming language?
What are the three parts of a simple empty class?
What does sksksk mean in text slang?
What is difference between oop and pop?
What is persistence in oop?
What is coupling in oops?