Professional Documents
Culture Documents
id - int
country - String
side - String
price - double
This method will take a String parameter along with the other parameter as array of Player
objects.
The method will return array of Player where the String parameter appears in the side attribute
(with case insensitive search).
This method should be called from main method and display the id of returned objects in
ascending order.
Before calling this method(searchPlayerForMatch) in the main method, use Scanner object to
read values for four Player objects referring the attributes in the above sequence.
then, read the value for search parameter.
Next call the method searchPlayerForMatch, write the logic to sort the id in ascending order (in
main method) and display the result.
Input:
1
India
Batting
2500000
2
Australia
Batting
1000000
3
Srilanka
Bowling
1700000
4
England
Bowling
2000000
Batting
Output:
1
2
--------------------------------------------------
Sample code snippet for reference:
Please use below code to build your solution.
--------------------------------------------------
}
}
class Player
{
//code to build Player class
}
-------------------------------------------------
If above issue is observed, then it is suggested to add one more explicit call to nextLine() after
reading numeric value.
}
}
class Player
{
//code to build Player class
}
Instruction :
Kindly mention class name as MyClass.