Every coding language will have the following elements.
- Data Types
- Variables
- Functions
- Objects
Every programming language consists of some kind of data. Datatype shows the specific data entered into a program. The data types are the keywords used to declare the type of the variable used in the program such as integer, real, character and string. The following is the syntax.
[c]variable :datatype=value;[/c]
The different memory locations where data resides are called objects. To access such an object it must have a name, and such a named object is called a Variable. The information stored inside an object is called as a value. Of course the machine itself typically has no idea how to interpret the information it contains, but the program certainly needs to know. For this reason a variable has a specific type. And it’s this type that constrains the use of that variable, such that only operations appropriate to the type may be performed. The following is the syantax.
[c]var variable_list : type;[/c]
Functions can be defined as a partitioned blocks of code in a program, which can be called any number of times during single execution of a program. Functions reduces the memory and complexity of the program. The following is the syntax.
[c]function name(argument(s): type1; argument(s): type2; ...): function_type;[/c]
In any object oriented programming language coding will be made up with classes and object, As every one know that object is nothing but an entity that have state, behavior.