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 does and I oop mean?
How do you answer polymorphism?
how to get the oracle certification? send me the answer
What is the diamond problem in inheritance?
What is encapsulation oop?
What is difference between abstraction and encapsulation?
What are objects in oop?
What is polymorphism and why is it important?
What is polymorphism explain?
What is polymorphism programming?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What do you mean by abstraction?
What is object and example?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
What is for loop and its syntax?