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
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
Why interface is used?
what is the drawback of classical methods in oops?
hi all..i want to know oops concepts clearly can any1 explain??
How do you explain polymorphism?
What is protected in oop?
What is debug class?what is trace class? What differences are between them? With examples.
Are polymorphisms mutations?
to find out the minimum of two integer number of two different classes using friend function
What is the example of polymorphism?
What is interface? When and where is it used?
What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }
what's the basic's in dot net
What is a class in oop?
Can main method override?