Computer Science, asked by SwagnikChakraborty, 9 hours ago

Write a java program to retrieve the player details based on the player id from the array of player objects.

You are provided with the class Player with private attributes such as int playerId, String playerName, int age, long phoneNumber with the necessary setters & getters and a four argument constructor.

Include a class PlayerUtility with the method public Player findPlayerDetailsById(Player[] arr, int playerIdToSearch) that accepts an array of player objects and playerId to be searched as an argument. This method should iterate the array of player objects and find the details of the player for the playerId passed as an argument and return the player object. If the playerId is not found then this method should return null.

In the Main class, you are provided with the main method and the details of the player added into the array.

You need to get the playerId to be searched and call the findPlayerDetailsById method and display the player details as shown in the sample input and output. If the returned value is null, then this method should display “No player found”.

Answers

Answered by meera4980
1

Explanation:

and playerId to be searched as an argument. This method should iterate the array of player objects and find the details of the player for the playerId passed as an argument and return the player object. If the playerId is not found then this method should return null.

In the Main class, you are provided with the main method and the details of the player added into the array.

Ckhfkhjgshfzhgsjgditdutdgjxjvcbkdkgduydtjxxjfutsttshgxgdjgdutdjydjhcjgdjgdjgdjgdjgdkgdjydjtdgjgdjy is a good night sweet dreams sleep well bye for now and hope you have a good night

You need to get the playerId to be searched and call the findPlayerDetailsById method and display the player details as shown in the sample input and output. If the returned value is null, then this method should display “No player found”.

Answered by nafibarli789
0

Answer:

Java exists as an object-oriented programming language that creates software for multiple platforms.

Explanation:

Java exists as a widely utilized object-oriented programming language and software platform that operates on billions of devices, including notebook computers, mobile devices, gaming consoles, medical devices, and many others. The restrictions and syntax of Java are based on the C and C++ languages.

Java exists as an object-oriented programming language that creates software for multiple platforms.

The java program is,

#SPJ3

Attachments:
Similar questions