A constructor is a member function of a class which initializes objects of a class. In C++, Constructor is automatically called when object(instance of class) create. It is special member function of the class. Some properties of the constructor are: 1.Constructor usually have the same name as the class name. 2.It do not have any return type,not even void. 3.It is called automatically when the object of the class is created. 4.It is used for initializing the value to data member of the class.
0 Comments
These operators are used to perform arithmetics operations.C++ provide various types of operators they are->
Operators Meaning + Addition - Subtraction * Multipication / Division 1.Platform Independent
2.User Friendly 3.Easy to learn and handle Errors are the unfavourable condition that aries during the execution of the program prevernting the outcome of the program.Errors are of three types they are-> Syntax errors: Errors that occur when you violate the rules of writing C/C++ syntax are known as syntax errors. Run Type errors : If any error is generated at run time is known as runtime error, in general these are raised because of writing wrong logic in the program. Logical errors: The errors which comes when the logic of program goes wrong. Operators refers to the actions to be taken between two or more data expressions.
Operators are basically of three types they are-> 1.Unary Operator->Operators which works with one operands are known as Unary Operators. 2.Binary operator->Operator which works between two operands are known as Binary Operatyors. 3.Ternary Operators->Operators that take three operands are known as Ternary operators. 4.Prefix Operators->Some operators are indicated before operands are called Postfix Operators. Literal/Constants refer to fixed values that the program may not alter during the execution of the program. Constants can be of any of the basic data types and can be divided into Integer Numerals, Floating-Point Numerals, Characters, Strings and Boolean Values.
Keywords are the special words that convey a special meaning to a language complier.
EXAMPLE-> if else switch run break continue for int switch while new float Tokens are the smallest individual unit in a C, C++, JAVA etc
Basically Tokens are of 5 types they are -> K->Keyword I->Identifiers L->Literal P->Punctuators/Seperators O->Operators Data type is a type of value stored in a variable which is used throughout a program as a constants to give a a meaningful result.
Encapsulation is the process of wrapping of data and function into a single unit(class) is known as Encapsulation.
Encapsulation is a way to implement the Data Hiding. |