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
Where is pseudocode used?
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What are constructors in oop?
Can you inherit a private class?
What is encapsulation selenium?
What is overriding in oop?
What is abstraction in oops?
What is encapsulation in simple terms?
Why is encapsulation used?
How to hide the base class functionality in Inheritance?
What does I oop mean?
Can an interface inherit a class?
What is meant by multiple inheritance?
What are oops functions?
#include