Thread Programming In java

Thread programming in java is concerned with how system utilizes its resources. Friendly interface, computations and other intensive tasks can take up a lot of processor time. A java program that...

Operator overloading in C++

As we know The variables of primitive data types can perform a number of different operations (functions) using operators like (+, - , /, *)/ For Example:  a + b * c ...

Area and Perimeter of rectangle in C++

Area and Perimeter both are the mathematical terms used with rectangle, area is the length multiplied by width while perimeter is the length of all sides of the rectangle. Now how...

Overloading Subtraction Operator in C++

Here we have overloaded subtraction operator for a specific class or one can say subtraction operator is overloaded for a self-defined data type in C++. The code is: ...

Assignment Operator Overloading in C++

After we do assignment operator overloading, we will then be able to assign two variables of our self-defined datatypes. Lets have a look at the below example: // Operator overloading in C++ //assignment operator overloading #include<iostream> using namespace std;   class Employee { private:     int idNum;     double salary; public:     Employee ( ) {         idNum = 0, salary = 0.0;     }       void setValues (int a, int b);     void operator= (Employee&emp );   };   void Employee::setValues ( int idN , int sal ) {       salary = sal; idNum = idN;   }   void Employee::operator = (Employee&emp)  // Assignment operator function {     salary = emp.salary; }   int main ( ) {       Employee emp1;     emp1.setValues(10,33);     Employee emp2;     emp2 = emp1;        // emp2 is calling object using assignment operator   } Now lets explain this...

Overloading steam insertion and extraction operators in C++

For putting data into the stream and getting data from the stream, the stream insertion and extraction operators are used, Now these operators are already defined for defined datatypes in C++,...

Overloading Addition operator in C++

Here we have overloaded addition operator for a specific class or one can say addition operator is overloaded for a self-defined data type in C++. The code is: ...

Object Oriented Programming and Databases

Programming itself evolved from several stages and now we have Object Oriented Programming as the most mature and popular approach. On the other hand, interaction with database has always been tricky...

Writing Factorial program in java

In mathematics, the factorial of any non-negative number let’s say X, is denoted by X! , which is equal to the product of all positive integers less than or equal to...

Increment operator overloading in C++

Increment operator in C++ is used to increase the value of a variable by 1 or some other fixed interval. normally it is used in loops. Now increment operator overloading is...