Create a class Team to hold data about a college sports team. The Team class holds...

80.2K

Verified Solution

Question

Programming

Create a class Team to hold data about a college sports team.The Team class holds data fields for college name (such as HamptonCollege), sport (such as Soccer), and team name (such as Tigers).Include a constructor that takes parameters for each field, and getmethods that return the values of the fields. Also include a publicfinal static String named MOTTO and initialize it to Sportsmanship!Save the class in Team.java. Write an application named TestTeamwith the main method which declares and instantiates three Teamobjects with different values for their fields. Accept field valuesas a user input (utilizing JOptionPane) for each of team fields andassign those to proper instances of Team class (three sets of threeinput strings will be needed to fill all fields in each of threeTeam objects). Add a displayTeams method which displays all thedata, including the motto, for each instantiated Team objects. Whendoing so use JOptionPane again and format the output in orderlyfashion, one team data per a separate line. Save the class asTestTeam .java.

Answer & Explanation Solved by verified expert
4.1 Ratings (518 Votes)
import javaxswingJOptionPaneclass Team private String collegeName private String sports private String teamName public static String MOTTO Sportsmanship public TeamString aCollegeName String aSportsString aTeamName super collegeName aCollegeName sports aSports teamName aTeamName public String getCollegeName return    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students