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
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Which type does string inherit from?
What is the main purpose of inheritance law?
What is destructor example?
What is the oops and benefits of oops programming?
What are functions in oop?
What is the importance of oop?
What is multilevel inheritance in oop?
Are polymorphisms mutations?
Where is pseudocode used?
What is class and example?
Whats oop mean?
Where You Can Use Interface in your Project
What is class in oop with example?
Why do we use inheritance?