given a class
In another class a function was written like:
Object myFun(Employee obj, String attribute)
//return proper attribute value without using conditions like If-Else, ternary or
// conditional operators like && etc.
Now if i call:
then this function should return name of Employee from object “obj” which was passed as parameter. So based on name of attribute value, it should return that object’s attribute value.