1. What do you understand by ‘operator overloading’? How does an
operator
overloading feature can negatively affect a programming language
despite its
obvious usefulness?
2. Show an example of aliasing using a reference or pointers. Why
did Java
programming language decided not to have explicit pointers like C
programming
language?
Need Unique answer please dont copy
1 ) Operator Overloading :
In Other terms Operator overloading is termed as the Polymorphism where maybe the different operators having the different varieties of the implementations which may be depending on the different number of arguments
Affecting of operator overloading in one case as an example :
+ operator is termed as the if there there are two integers then there will be sum, if there are two words then there maybe concatenation, this is the negatively effect in the operator overloading
2 ) Aliasing using Pointers :
void process_data(float *a, float *b, float m, int n)
{
int i;
for (i = 0; i < n; i++)
{
b[i] = a[i] * m;
}
}
The main use of the pointers is to allocate and then de allocate memory managemnet, but the java mainly contains the automatic garbage collection so the memory management concept is not done in the java, so the java does not uses the explicit pointers
Get Answers For Free
Most questions answered within 1 hours.